mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
fix(pwsh): remove cached tip command when rendering a new prompt
This commit is contained in:
parent
1474979804
commit
7368c6541e
|
@ -127,7 +127,7 @@ New-Module -Name "oh-my-posh-core" -ScriptBlock {
|
||||||
$cleanPSWD = Get-CleanPSWD
|
$cleanPSWD = Get-CleanPSWD
|
||||||
$command = $null
|
$command = $null
|
||||||
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$command, [ref]$null)
|
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$command, [ref]$null)
|
||||||
$command = $command.Trim().Split(" ", 2) | Select-Object -First 1
|
$command = $command.TrimStart().Split(" ", 2) | Select-Object -First 1
|
||||||
if ($command -eq $script:ToolTipCommand) {
|
if ($command -eq $script:ToolTipCommand) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -397,6 +397,9 @@ Example:
|
||||||
# remove any posh-git status
|
# remove any posh-git status
|
||||||
$env:POSH_GIT_STATUS = $null
|
$env:POSH_GIT_STATUS = $null
|
||||||
|
|
||||||
|
# remove cached tip command
|
||||||
|
$script:ToolTipCommand = ""
|
||||||
|
|
||||||
# restore the orignal last exit code
|
# restore the orignal last exit code
|
||||||
$global:LASTEXITCODE = $script:OriginalLastExitCode
|
$global:LASTEXITCODE = $script:OriginalLastExitCode
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue