File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
packages/powershell/oh-my-posh Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -97,12 +97,11 @@ Edit `$PROFILE` in your preferred PowerShell version and add the following lines
9797[ScriptBlock]$Prompt = {
9898 $realLASTEXITCODE = $global:LASTEXITCODE
9999 if ($realLASTEXITCODE -isnot [int]) {
100- $realLASTEXITCODE = 0
100+ $realLASTEXITCODE = 0
101101 }
102102 $startInfo = New-Object System.Diagnostics.ProcessStartInfo
103103 $startInfo.FileName = "C:\tools\oh-my-posh.exe"
104- $config = $global:PoshSettings.Theme
105- $cleanPWD = $PWD.ToString().TrimEnd("\")
104+ $cleanPWD = $PWD.ProviderPath.TrimEnd("\")
106105 $startInfo.Arguments = "-config=""C:\Users\User\Downloads\downloadedtheme.json"" -error=$realLASTEXITCODE -pwd=""$cleanPWD"""
107106 $startInfo.Environment["TERM"] = "xterm-256color"
108107 $startInfo.CreateNoWindow = $true
Original file line number Diff line number Diff line change @@ -52,14 +52,14 @@ function Set-PoshPrompt {
5252 $startInfo = New-Object System.Diagnostics.ProcessStartInfo
5353 $startInfo.FileName = Get-PoshCommand
5454 $config = $global :PoshSettings.Theme
55- $cleanPWD = $PWD.ToString () .TrimEnd(" \" )
55+ $cleanPWD = $PWD.ProviderPath .TrimEnd (" \" )
5656 $startInfo.Arguments = " -config="" $config "" -error=$realLASTEXITCODE -pwd="" $cleanPWD "" "
5757 $startInfo.Environment [" TERM" ] = " xterm-256color"
5858 $startInfo.CreateNoWindow = $true
5959 $startInfo.StandardOutputEncoding = [System.Text.Encoding ]::UTF8
6060 $startInfo.RedirectStandardOutput = $true
6161 $startInfo.UseShellExecute = $false
62- if ($PWD.Provider -eq ' FileSystem' ) {
62+ if ($PWD.Provider.Name -eq ' FileSystem' ) {
6363 $startInfo.WorkingDirectory = $PWD.ProviderPath
6464 }
6565 $process = New-Object System.Diagnostics.Process
You can’t perform that action at this time.
0 commit comments