Skip to content

Commit e798ad0

Browse files
fix: user correct path and statement
resolves #119
1 parent 33d099a commit e798ad0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

docs/docs/installation.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

packages/powershell/oh-my-posh/oh-my-posh.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)