From 3ec09a1c3dba598261f0e43787081574100f313e Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 6 Feb 2024 09:32:32 +0100 Subject: [PATCH] Terminal: Fix powershell integration Previously a "1" was printed every time a powershell terminal was started. Change-Id: Ibd6f9dc9de8ba11ede98e13ca2f65ba5a99536fb Reviewed-by: Cristian Adam --- src/plugins/terminal/shellintegration.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/terminal/shellintegration.cpp b/src/plugins/terminal/shellintegration.cpp index 2d3e8f986f7..fc97d76cff2 100644 --- a/src/plugins/terminal/shellintegration.cpp +++ b/src/plugins/terminal/shellintegration.cpp @@ -199,7 +199,9 @@ void ShellIntegration::prepareProcess(Utils::Process &process) m_tempDir.filePath(filesToCopy.pwsh.script.fileName())); 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); } else if (cmd.executable().baseName() == "cmd") { const FilePath rcPath = filesToCopy.clink.script;