This commit is contained in:
Roman Shevchenko
2013-04-22 18:14:37 +02:00
parent df7641385a
commit 0bae6faace
@@ -220,29 +220,22 @@ public class ExecUtil {
public static List<String> getTerminalCommand(@Nullable String title, @NotNull String command) {
if (SystemInfo.isWindows) {
title = title != null ? title.replace("\"", "'") : "";
return Arrays.asList("cmd.exe", "/c", "start", GeneralCommandLine.inescapableQuote(title), command);
return Arrays.asList(getWindowsShellName(), "/c", "start", GeneralCommandLine.inescapableQuote(title), command);
}
else if (SystemInfo.isMac) {
return Arrays.asList(getOpenCommandPath(), "-a", "Terminal", command); // todo: title?
}
else if (hasKdeTerminal.getValue()) {
return Arrays.asList("/usr/bin/konsole", "-e", command); // todo: title?
return title != null ? Arrays.asList("/usr/bin/konsole", "-p", "tabtitle=\"" + title.replace("\"", "'") + "\"", "-e", command)
: Arrays.asList("/usr/bin/konsole", "-e", command);
}
else if (hasGnomeTerminal.getValue()) {
if (title != null) {
return Arrays.asList("/usr/bin/gnome-terminal", "-t", title, "-x", command);
}
else {
return Arrays.asList("/usr/bin/gnome-terminal", "-x", command);
}
return title != null ? Arrays.asList("/usr/bin/gnome-terminal", "-t", title, "-x", command)
: Arrays.asList("/usr/bin/gnome-terminal", "-x", command);
}
else if (hasXTerm.getValue()) {
if (title != null) {
return Arrays.asList("/usr/bin/xterm", "-T", title, "-e", command);
}
else {
return Arrays.asList("/usr/bin/xterm", "-e", command);
}
return title != null ? Arrays.asList("/usr/bin/xterm", "-T", title, "-e", command)
: Arrays.asList("/usr/bin/xterm", "-e", command);
}
throw new UnsupportedSystemException();