diff --git a/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java b/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java index 9887b956b1d9..883718711307 100644 --- a/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java +++ b/platform/platform-api/src/com/intellij/execution/util/ExecUtil.java @@ -220,29 +220,22 @@ public class ExecUtil { public static List 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();