fix(pwsh): restore prompt function override

This commit is contained in:
Jan De Dobbeleer 2024-07-17 07:05:54 +02:00 committed by Jan De Dobbeleer
parent 17134cdb29
commit 024c8b6ed5

View file

@ -397,7 +397,7 @@ Example:
} }
} }
$promptFunction = { function prompt {
# store the orignal last command execution status # store the orignal last command execution status
if ($global:NVS_ORIGINAL_LASTEXECUTIONSTATUS -is [bool]) { if ($global:NVS_ORIGINAL_LASTEXECUTIONSTATUS -is [bool]) {
# make it compatible with NVS auto-switching, if enabled # make it compatible with NVS auto-switching, if enabled
@ -436,8 +436,6 @@ Example:
$global:LASTEXITCODE = $script:OriginalLastExitCode $global:LASTEXITCODE = $script:OriginalLastExitCode
} }
$Function:prompt = $promptFunction
# set secondary prompt # set secondary prompt
Set-PSReadLineOption -ContinuationPrompt ((Start-Utf8Process $script:OMPExecutable @("print", "secondary", "--config=$env:POSH_THEME", "--shell=$script:ShellName")) -join "`n") Set-PSReadLineOption -ContinuationPrompt ((Start-Utf8Process $script:OMPExecutable @("print", "secondary", "--config=$env:POSH_THEME", "--shell=$script:ShellName")) -join "`n")
@ -478,6 +476,7 @@ Example:
"Export-PoshTheme" "Export-PoshTheme"
"Get-PoshThemes" "Get-PoshThemes"
"Start-Utf8Process" "Start-Utf8Process"
"prompt"
) )
} | Import-Module -Global } | Import-Module -Global