fix(pwsh): force initialization of NoExitCode

resolves #4128
This commit is contained in:
Jan De Dobbeleer 2023-08-05 17:47:41 +02:00 committed by Jan De Dobbeleer
parent 3f1eb821f0
commit c78aa60455

View file

@ -417,6 +417,13 @@ Example:
$terminalWidth = 0
}
# in some cases we have an empty $script:NoExitCode
# this is a workaround to make sure we always have a value
# see https://github.com/JanDeDobbeleer/oh-my-posh/issues/4128
if ($null -eq $script:NoExitCode) {
$script:NoExitCode = $true
}
# set the cursor positions, they are zero based so align with other platforms
$env:POSH_CURSOR_LINE = $Host.UI.RawUI.CursorPosition.Y + 1
$env:POSH_CURSOR_COLUMN = $Host.UI.RawUI.CursorPosition.X + 1