forked from qt-creator/qt-creator
Terminal: Fix opening terminals on remote devices
When the active project is on a remote device the working directory is set to its root directory. In this case we need to find the right shell binary from the remote device. Change-Id: I6b541273d23a8de5442ac041b28d81984ed5ef65 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -106,6 +106,17 @@ void TerminalPane::openTerminal(const OpenTerminalParameters ¶meters)
|
||||
}
|
||||
}
|
||||
|
||||
if (parametersCopy.workingDirectory->needsDevice() && !parametersCopy.shellCommand) {
|
||||
const FilePath shell = parametersCopy.workingDirectory->withNewPath(
|
||||
parametersCopy.environment
|
||||
.value_or(parametersCopy.workingDirectory->deviceEnvironment())
|
||||
.value_or("SHELL", "/bin/sh"));
|
||||
if (!shell.isExecutableFile())
|
||||
parametersCopy.workingDirectory.reset();
|
||||
else
|
||||
parametersCopy.shellCommand = CommandLine{shell, {}};
|
||||
}
|
||||
|
||||
const auto terminalWidget = new TerminalWidget(&m_tabWidget, parametersCopy);
|
||||
|
||||
using namespace Constants;
|
||||
|
Reference in New Issue
Block a user