aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/projectexplorer/devicesupport/devicemanager.cpp')
-rw-r--r--src/plugins/projectexplorer/devicesupport/devicemanager.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
index 9f8e0594fd8..aa017df46b0 100644
--- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
+++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
@@ -14,9 +14,10 @@
#include <utils/environment.h>
#include <utils/fsengine/fsengine.h>
#include <utils/persistentsettings.h>
+#include <utils/process.h>
#include <utils/qtcassert.h>
-#include <utils/qtcprocess.h>
#include <utils/stringutils.h>
+#include <utils/terminalhooks.h>
#include <QHash>
#include <QMutex>
@@ -442,6 +443,13 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager
device->openTerminal(env, filePath);
};
+ deviceHooks.osType = [](const FilePath &filePath) {
+ auto device = DeviceManager::deviceForPath(filePath);
+ if (!device)
+ return OsTypeLinux;
+ return device->osType();
+ };
+
DeviceProcessHooks processHooks;
processHooks.processImplHook = [](const FilePath &filePath) -> ProcessInterface * {
@@ -456,7 +464,23 @@ DeviceManager::DeviceManager(bool isInstance) : d(std::make_unique<DeviceManager
return device->systemEnvironment();
};
- QtcProcess::setRemoteProcessHooks(processHooks);
+ Process::setRemoteProcessHooks(processHooks);
+
+ Terminal::Hooks::instance().getTerminalCommandsForDevicesHook().set(
+ [this]() -> QList<Terminal::NameAndCommandLine> {
+ QList<Terminal::NameAndCommandLine> result;
+ for (const IDevice::ConstPtr device : d->devices) {
+ if (device->type() == Constants::DESKTOP_DEVICE_TYPE)
+ continue;
+
+ const FilePath shell = Terminal::defaultShellForDevice(device->rootPath());
+
+ if (!shell.isEmpty())
+ result << Terminal::NameAndCommandLine{device->displayName(),
+ CommandLine{shell, {}}};
+ }
+ return result;
+ });
}
DeviceManager::~DeviceManager()