Function 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.

string[] getTerminalCommand() nothrow @trusted;

Note

This function always returns empty array on non-freedesktop systems.

Example

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