diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index a008fdf2fd7..31d05b14c14 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1586,7 +1586,8 @@ void SimpleTargetRunnerPrivate::start() m_stopRequested = false; QVariantHash extraData = m_extraData; - extraData[TERMINAL_SHELL_NAME] = m_command.executable().fileName(); + extraData[TERMINAL_SHELL_NAME] + = q->runControl()->target()->activeRunConfiguration()->displayName(); m_process.setCommand(cmdLine); m_process.setEnvironment(env); diff --git a/src/plugins/terminal/terminalprocessimpl.cpp b/src/plugins/terminal/terminalprocessimpl.cpp index 3ae7d360928..33efbf49cc4 100644 --- a/src/plugins/terminal/terminalprocessimpl.cpp +++ b/src/plugins/terminal/terminalprocessimpl.cpp @@ -35,7 +35,12 @@ public: return m_fallbackStubCreator->startStubProcess(setup); } - const Id id = Id::fromString(setup.m_commandLine.toUserOutput()); + const QString shellName + = setup.m_extraData + .value(TERMINAL_SHELL_NAME, setup.m_commandLine.executable().fileName()) + .toString(); + + const Id id = Id::fromString(shellName); TerminalWidget *terminal = m_terminalPane->stoppedTerminalWithId(id); @@ -45,14 +50,10 @@ public: if (!terminal) { terminal = new TerminalWidget(nullptr, openParameters); - - terminal->setShellName( - setup.m_extraData - .value(TERMINAL_SHELL_NAME, setup.m_commandLine.executable().fileName()) - .toString()); - + terminal->setShellName(shellName); m_terminalPane->addTerminal(terminal, "App"); } else { + terminal->setShellName(shellName); terminal->restart(openParameters); }