mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-03 15:27:26 -08:00
parent
f23968a39c
commit
ee130605db
|
@ -83,6 +83,12 @@ New-Module -Name "oh-my-posh-core" -ScriptBlock {
|
||||||
$StartInfo.RedirectStandardError = $StartInfo.RedirectStandardInput = $StartInfo.RedirectStandardOutput = $true
|
$StartInfo.RedirectStandardError = $StartInfo.RedirectStandardInput = $StartInfo.RedirectStandardOutput = $true
|
||||||
$StartInfo.UseShellExecute = $false
|
$StartInfo.UseShellExecute = $false
|
||||||
if ($PWD.Provider.Name -eq 'FileSystem') {
|
if ($PWD.Provider.Name -eq 'FileSystem') {
|
||||||
|
# make sure we're in a valid directory
|
||||||
|
# if not, go back HOME
|
||||||
|
if (-not (Test-Path -Path $PWD)) {
|
||||||
|
Write-Host "Unable to find the current directory, falling back to $HOME" -ForegroundColor Red
|
||||||
|
Set-Location $HOME
|
||||||
|
}
|
||||||
$StartInfo.WorkingDirectory = $PWD.ProviderPath
|
$StartInfo.WorkingDirectory = $PWD.ProviderPath
|
||||||
}
|
}
|
||||||
$StartInfo.CreateNoWindow = $true
|
$StartInfo.CreateNoWindow = $true
|
||||||
|
|
Loading…
Reference in a new issue