ProjectExplorer: Remove IDevice::terminalCommand

Since Terminals can now be started for device file paths, there
is no need anymore for IDevice::terminalCommand.

Change-Id: I01c831ea7ee29d53efa6880631e8c6d54a4316aa
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-03-01 09:57:43 +01:00
parent 517400e7f6
commit 86da87d306
10 changed files with 56 additions and 46 deletions

View File

@@ -8,6 +8,24 @@
namespace Utils::Terminal {
FilePath defaultShellForDevice(const FilePath &deviceRoot)
{
if (!deviceRoot.needsDevice())
return {};
// TODO: Windows ?
const Environment env = deviceRoot.deviceEnvironment();
FilePath shell = FilePath::fromUserInput(env.value_or("SHELL", "/bin/sh"));
if (!shell.isAbsolutePath())
shell = env.searchInPath(shell.nativePath());
if (shell.isEmpty())
return shell;
return shell.onDevice(deviceRoot);
}
struct HooksPrivate
{
HooksPrivate()