Terminal: Fix powershell integration

Previously a "1" was printed every time a powershell terminal
was started.

Change-Id: Ibd6f9dc9de8ba11ede98e13ca2f65ba5a99536fb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-02-06 09:32:32 +01:00
parent 3259b1cb25
commit 3ec09a1c3d

View File

@@ -199,7 +199,9 @@ void ShellIntegration::prepareProcess(Utils::Process &process)
m_tempDir.filePath(filesToCopy.pwsh.script.fileName())); m_tempDir.filePath(filesToCopy.pwsh.script.fileName()));
rcPath.copyFile(tmpRc); rcPath.copyFile(tmpRc);
cmd.addArgs(QString("-noexit -command try { . \"%1\" } catch {}{1}").arg(tmpRc.nativePath()), cmd.addArgs(QString("-noexit -command try { . \"%1\" } catch {Write-Host \"Shell "
"integration error:\" $_}")
.arg(tmpRc.nativePath()),
CommandLine::Raw); CommandLine::Raw);
} else if (cmd.executable().baseName() == "cmd") { } else if (cmd.executable().baseName() == "cmd") {
const FilePath rcPath = filesToCopy.clink.script; const FilePath rcPath = filesToCopy.clink.script;