aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/terminal/shellintegration.cpp
diff options
context:
space:
mode:
authorJarek Kobus <[email protected]>2024-05-16 14:07:59 +0200
committerJarek Kobus <[email protected]>2024-05-22 09:13:41 +0000
commit982ad2424352f07877fb0a0af63df3790ebe165d (patch)
treed6114a48b392e4399526aea78e0fb9637a244662 /src/plugins/terminal/shellintegration.cpp
parentd857af4cec9d1e3651f6c4759066ae953cd730c0 (diff)
CommandLine: Reuse new c'tor
Change-Id: Id154881b4f5d8c488e5c1f5e0f843d36bf838759 Reviewed-by: Orgad Shaneh <[email protected]> Reviewed-by: <[email protected]>
Diffstat (limited to 'src/plugins/terminal/shellintegration.cpp')
-rw-r--r--src/plugins/terminal/shellintegration.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/terminal/shellintegration.cpp b/src/plugins/terminal/shellintegration.cpp
index 5dfd450e68c..1303f922884 100644
--- a/src/plugins/terminal/shellintegration.cpp
+++ b/src/plugins/terminal/shellintegration.cpp
@@ -133,7 +133,7 @@ void ShellIntegration::onOsc(int cmd, std::string_view str, bool initial, bool f
qCDebug(integrationLog) << "OSC 133:" << data;
} else if (cmd == 633 && command.length() == 1) {
if (command[0] == 'E') {
- CommandLine cmdLine = CommandLine::fromUserInput(data.toString());
+ const CommandLine cmdLine = CommandLine::fromUserInput(data.toString());
emit commandChanged(cmdLine);
} else if (command[0] == 'D') {
emit commandChanged({});
@@ -174,12 +174,10 @@ void ShellIntegration::prepareProcess(Utils::Process &process)
m_tempDir.filePath(filesToCopy.bash.rcFile.fileName()));
rcPath.copyFile(tmpRc);
- CommandLine newCmd = {cmd.executable(), {"--init-file", tmpRc.nativePath()}};
-
if (cmd.arguments() == "-l")
env.set("VSCODE_SHELL_LOGIN", "1");
- cmd = newCmd;
+ cmd = {cmd.executable(), {"--init-file", tmpRc.nativePath()}};
} else if (cmd.executable().baseName() == "zsh") {
for (const FileToCopy &file : filesToCopy.zsh.files) {
const auto copyResult = file.source.copyFile(