getTerminalCommand

Detect command which will run program in terminal emulator. It tries to detect your desktop environment and find default terminal emulator for it. If all guesses failed, it uses ["xterm", "-e"] as fallback. Note: This function always returns empty array on non-freedesktop systems.

nothrow @trusted
string[]
getTerminalCommand
()

Examples

if (isFreedesktop)
{
    import desktopfile.paths : EnvGuard;
    EnvGuard pathGuard = EnvGuard("PATH", ":");
    assert(getTerminalCommand() == ["xterm", "-e"]);
}
else
{
    assert(getTerminalCommand().empty);
}

Meta