Terminal: Escape spaces for powershell paths

For the users that have a space in their user name, the location of the
shellintegration.ps1 is a path with a space in it.

This patchset fixes the escaping of that space.

Change-Id: Iae84b2e8a8f1b4e2b7e523e28417caaeb77bc5cd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Cristian Adam
2024-02-06 14:38:46 +01:00
parent 03c19e81ed
commit 426dbc2f94

View File

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