diff options
author | Marcus Tillmanns <[email protected]> | 2023-08-10 06:44:27 +0200 |
---|---|---|
committer | Marcus Tillmanns <[email protected]> | 2023-08-17 07:09:48 +0000 |
commit | 92355bf40d2ff6a44465aa085fe018db2e50e919 (patch) | |
tree | b0484235b3ca3ba6ecc2c553d0ed4200261808ac /src/libs/utils/terminalhooks.cpp | |
parent | d611fe6821347858e435e88efe98d972e29d2c91 (diff) |
Terminal: Lazily open remote terminals
Move the burden of finding the shell of a device from the shell menu
to the TerminalWidget, so that opening the shell menu does not block
the ui.
Change-Id: I7f2e5a891f20faa53a1e3eec879866219f9bee0b
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/libs/utils/terminalhooks.cpp')
-rw-r--r-- | src/libs/utils/terminalhooks.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/libs/utils/terminalhooks.cpp b/src/libs/utils/terminalhooks.cpp index 3bda25b109c..f1420755c59 100644 --- a/src/libs/utils/terminalhooks.cpp +++ b/src/libs/utils/terminalhooks.cpp @@ -17,6 +17,9 @@ FilePath defaultShellForDevice(const FilePath &deviceRoot) return deviceRoot.withNewPath("cmd.exe").searchInPath(); const Environment env = deviceRoot.deviceEnvironment(); + if (!env.hasChanges()) + return {}; + FilePath shell = FilePath::fromUserInput(env.value_or("SHELL", "/bin/sh")); if (!shell.isAbsolutePath()) @@ -32,7 +35,6 @@ class HooksPrivate { public: HooksPrivate() - : m_getTerminalCommandsForDevicesHook([] { return QList<NameAndCommandLine>{}; }) { auto openTerminal = [](const OpenTerminalParameters ¶meters) { DeviceFileHooks::instance().openTerminal(parameters.workingDirectory.value_or( @@ -79,8 +81,6 @@ public: return m_openTerminal; } - Hooks::GetTerminalCommandsForDevicesHook m_getTerminalCommandsForDevicesHook; - private: Hooks::OpenTerminal m_openTerminal; Hooks::CreateTerminalProcessInterface m_createTerminalProcessInterface; @@ -111,11 +111,6 @@ ProcessInterface *Hooks::createTerminalProcessInterface() const return d->createTerminalProcessInterface()(); } -Hooks::GetTerminalCommandsForDevicesHook &Hooks::getTerminalCommandsForDevicesHook() -{ - return d->m_getTerminalCommandsForDevicesHook; -} - void Hooks::addCallbackSet(const QString &name, const CallbackSet &callbackSet) { d->addCallbackSet(name, callbackSet); |