From f61aff69fbd2300aa3747434ad9a73a413daa3d2 Mon Sep 17 00:00:00 2001 From: Elizaveta Shashkova Date: Thu, 14 Dec 2017 14:24:12 +0300 Subject: [PATCH] "Show command line ..." breaks Coverage, Profiler and Concurrency Diagram (PY-27431) It looks like this option is useless for these actions. It isn't available for Test run configurations - the most frequent use case for coverage. An output console isn't available for Concurrency Diagram, so users can't type any commands there. It doesn't work correctly with profiler's wrapping. --- .../jetbrains/python/run/PythonScriptCommandLineState.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/src/com/jetbrains/python/run/PythonScriptCommandLineState.java b/python/src/com/jetbrains/python/run/PythonScriptCommandLineState.java index 54b64b1217cc..3407aa844e68 100644 --- a/python/src/com/jetbrains/python/run/PythonScriptCommandLineState.java +++ b/python/src/com/jetbrains/python/run/PythonScriptCommandLineState.java @@ -26,6 +26,7 @@ import com.intellij.execution.configurations.ParametersList; import com.intellij.execution.configurations.ParamsGroup; import com.intellij.execution.console.ConsoleExecuteAction; import com.intellij.execution.executors.DefaultDebugExecutor; +import com.intellij.execution.executors.DefaultRunExecutor; import com.intellij.execution.filters.UrlFilter; import com.intellij.execution.process.OSProcessHandler; import com.intellij.execution.process.ProcessHandler; @@ -72,6 +73,11 @@ public class PythonScriptCommandLineState extends PythonCommandLineState { Project project = myConfig.getProject(); if (myConfig.showCommandLineAfterwards() && !myConfig.emulateTerminal()) { + if (executor.getId() != DefaultDebugExecutor.EXECUTOR_ID && executor.getId() != DefaultRunExecutor.EXECUTOR_ID) { + // disable "Show command line" for all executors except of Run and Debug, because it's useless + return super.execute(executor, processStarter, patchers); + } + if (executor.getId() == DefaultDebugExecutor.EXECUTOR_ID) { return super.execute(executor, processStarter, ArrayUtil.append(patchers, new CommandLinePatcher() { @Override