fix: theme paths with spaces

resolves #100
This commit is contained in:
Jan De Dobbeleer 2020-10-26 16:23:26 +01:00 committed by Jan De Dobbeleer
parent 6deeb55fd2
commit 33c40ebf39
2 changed files with 3 additions and 3 deletions

View file

@ -93,14 +93,14 @@ Edit `$PROFILE` in your preferred PowerShell version and add the following lines
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = "C:\tools\oh-my-posh.exe"
$config = $global:PoshSettings.Theme
$startInfo.Arguments = "-config C:\Users\User\Downloads\downloadedtheme.json -pwd $PWD -error $realLASTEXITCODE"
$startInfo.Arguments = "-config ""C:\Users\User\Downloads\downloadedtheme.json"" -pwd ""$PWD"" -error $realLASTEXITCODE"
$startInfo.Environment["TERM"] = "xterm-256color"
$startInfo.CreateNoWindow = $true
$startInfo.StandardOutputEncoding = [System.Text.Encoding]::UTF8
$startInfo.RedirectStandardOutput = $true
$startInfo.UseShellExecute = $false
if ($PWD.Provider.Name -eq "FileSystem") {
$startInfo.WorkingDirectory = $PWD
$startInfo.WorkingDirectory = "$PWD"
}
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $startInfo

View file

@ -51,7 +51,7 @@ function Set-PoshPrompt {
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = Get-PoshCommand
$config = $global:PoshSettings.Theme
$startInfo.Arguments = "-config $config -pwd ""$PWD"" -error $realLASTEXITCODE"
$startInfo.Arguments = "-config ""$config"" -pwd ""$PWD"" -error $realLASTEXITCODE"
$startInfo.Environment["TERM"] = "xterm-256color"
$startInfo.CreateNoWindow = $true
$startInfo.StandardOutputEncoding = [System.Text.Encoding]::UTF8