diff --git a/internal/shell/powershell.go b/internal/shell/powershell.go index 622d30e0..1aaa0d68 100644 --- a/internal/shell/powershell.go +++ b/internal/shell/powershell.go @@ -33,12 +33,13 @@ const hook = ` {{.EnvContent}} $__VFOX_PID=$pid; +$originalPrompt = $function:prompt; function prompt { $export = &"{{.SelfPath}}" env -s pwsh; if ($export) { - Invoke-Expression -Command $export; + Invoke-Expression -Command $export; } - return "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + &$originalPrompt; } Register-EngineEvent -SourceIdentifier PowerShell.Exiting -SupportEvent -Action {