From 88eda2322bb606387de5949944a8006424d3f510 Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Sat, 30 Jul 2022 23:36:20 +0300 Subject: [PATCH] BuildEnvironmentWidget: Override 'Open Terminal' func to open build dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the user is opening a terminal in the build environment then probably the intention is to do something in the build dir rather than in the home dir. Also, most shells/terminals have a shortcut to go to the home dir but they have no idea about the build dir so it is much harder to get there. Change-Id: Ia259def7a4915fe86370fc183fb1e38ef6644c4d Reviewed-by: Reviewed-by: André Hartmann Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/buildconfiguration.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 6ecd8e456d2..06e3bb3936f 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -44,6 +44,7 @@ #include "target.h" #include "toolchain.h" +#include #include #include @@ -93,6 +94,12 @@ public: envWidget->setBaseEnvironmentText(bc->baseEnvironmentText()); envWidget->setUserChanges(bc->userEnvironmentChanges()); + const EnvironmentWidget::OpenTerminalFunc openTerminalFunc + = [bc](const Utils::Environment &env) { + Core::FileUtils::openTerminal(bc->buildDirectory(), env); + }; + envWidget->setOpenTerminalFunc(openTerminalFunc); + connect(envWidget, &EnvironmentWidget::userChangesChanged, this, [bc, envWidget] { bc->setUserEnvironmentChanges(envWidget->userChanges()); });