mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-12 14:04:05 -08:00
fix(pwsh): ignore remove when in constrained language mode
This commit is contained in:
parent
4056729e8e
commit
8d9fe9d3c8
|
@ -354,12 +354,14 @@ Example:
|
||||||
function Enable-PoshLineError {}
|
function Enable-PoshLineError {}
|
||||||
|
|
||||||
# perform cleanup on removal so a new initialization in current session works
|
# perform cleanup on removal so a new initialization in current session works
|
||||||
$ExecutionContext.SessionState.Module.OnRemove += {
|
if ($ExecutionContext.SessionState.LanguageMode -ne "ConstrainedLanguage") {
|
||||||
if ((Get-PSReadLineKeyHandler -Key Spacebar).Function -eq 'OhMyPoshSpaceKeyHandler') {
|
$ExecutionContext.SessionState.Module.OnRemove += {
|
||||||
Remove-PSReadLineKeyHandler -Key Spacebar
|
if ((Get-PSReadLineKeyHandler -Key Spacebar).Function -eq 'OhMyPoshSpaceKeyHandler') {
|
||||||
}
|
Remove-PSReadLineKeyHandler -Key Spacebar
|
||||||
if ((Get-PSReadLineKeyHandler -Key Enter).Function -eq 'OhMyPoshEnterKeyHandler') {
|
}
|
||||||
Set-PSReadLineKeyHandler -Key Enter -Function AcceptLine
|
if ((Get-PSReadLineKeyHandler -Key Enter).Function -eq 'OhMyPoshEnterKeyHandler') {
|
||||||
|
Set-PSReadLineKeyHandler -Key Enter -Function AcceptLine
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue