mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix(pwsh): call convert-path before setting workingdirectory
Only for FileSystem psprovider
This commit is contained in:
parent
39a272af76
commit
a31d718fcb
|
@ -1,5 +1,4 @@
|
||||||
function global:Start-Utf8Process
|
function global:Start-Utf8Process {
|
||||||
{
|
|
||||||
param(
|
param(
|
||||||
[string] $FileName,
|
[string] $FileName,
|
||||||
[string] $Arguments
|
[string] $Arguments
|
||||||
|
@ -12,7 +11,9 @@ function global:Start-Utf8Process
|
||||||
$StartInfo.FileName = $filename
|
$StartInfo.FileName = $filename
|
||||||
$StartInfo.Arguments = $Arguments
|
$StartInfo.Arguments = $Arguments
|
||||||
$StartInfo.UseShellExecute = $false
|
$StartInfo.UseShellExecute = $false
|
||||||
$StartInfo.WorkingDirectory = $PWD #when UseShellExecute=false, workingDirectory=""
|
if ($pwd.provider.name -eq "FileSystem") { #workingdirectory does not work with registry path
|
||||||
|
$StartInfo.WorkingDirectory = convert-path $pwd #when UseShellExecute=false, workingDirectory=""
|
||||||
|
}
|
||||||
$StartInfo.CreateNoWindow = $true
|
$StartInfo.CreateNoWindow = $true
|
||||||
$_ = $Process.Start();
|
$_ = $Process.Start();
|
||||||
$_ = $Process.WaitForExit();
|
$_ = $Process.WaitForExit();
|
||||||
|
@ -192,7 +193,8 @@ function global:Enable-PoshTransientPrompt {
|
||||||
[Console]::OutputEncoding = [Text.Encoding]::UTF8
|
[Console]::OutputEncoding = [Text.Encoding]::UTF8
|
||||||
try {
|
try {
|
||||||
[Microsoft.PowerShell.PSConsoleReadLine]::InvokePrompt()
|
[Microsoft.PowerShell.PSConsoleReadLine]::InvokePrompt()
|
||||||
} finally {
|
}
|
||||||
|
finally {
|
||||||
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
|
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
|
||||||
[Console]::OutputEncoding = $previousOutputEncoding
|
[Console]::OutputEncoding = $previousOutputEncoding
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue