Skip to content

Commit

Permalink
fix: user correct path and statement
Browse files Browse the repository at this point in the history
resolves #119
  • Loading branch information
JanDeDobbeleer committed Nov 2, 2020
1 parent 33d099a commit e798ad0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions docs/docs/installation.mdx
Expand Up @@ -97,12 +97,11 @@ Edit `$PROFILE` in your preferred PowerShell version and add the following lines
[ScriptBlock]$Prompt = {
$realLASTEXITCODE = $global:LASTEXITCODE
if ($realLASTEXITCODE -isnot [int]) {
$realLASTEXITCODE = 0
$realLASTEXITCODE = 0
}
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = "C:\tools\oh-my-posh.exe"
$config = $global:PoshSettings.Theme
$cleanPWD = $PWD.ToString().TrimEnd("\")
$cleanPWD = $PWD.ProviderPath.TrimEnd("\")
$startInfo.Arguments = "-config=""C:\Users\User\Downloads\downloadedtheme.json"" -error=$realLASTEXITCODE -pwd=""$cleanPWD"""
$startInfo.Environment["TERM"] = "xterm-256color"
$startInfo.CreateNoWindow = $true
Expand Down
4 changes: 2 additions & 2 deletions packages/powershell/oh-my-posh/oh-my-posh.psm1
Expand Up @@ -52,14 +52,14 @@ function Set-PoshPrompt {
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = Get-PoshCommand
$config = $global:PoshSettings.Theme
$cleanPWD = $PWD.ToString().TrimEnd("\")
$cleanPWD = $PWD.ProviderPath.TrimEnd("\")
$startInfo.Arguments = "-config=""$config"" -error=$realLASTEXITCODE -pwd=""$cleanPWD"""
$startInfo.Environment["TERM"] = "xterm-256color"
$startInfo.CreateNoWindow = $true
$startInfo.StandardOutputEncoding = [System.Text.Encoding]::UTF8
$startInfo.RedirectStandardOutput = $true
$startInfo.UseShellExecute = $false
if ($PWD.Provider -eq 'FileSystem') {
if ($PWD.Provider.Name -eq 'FileSystem') {
$startInfo.WorkingDirectory = $PWD.ProviderPath
}
$process = New-Object System.Diagnostics.Process
Expand Down

0 comments on commit e798ad0

Please sign in to comment.