We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf27369 commit 2d0658aCopy full SHA for 2d0658a
src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs
@@ -504,7 +504,7 @@ private void PopPowerShell(RunspaceChangeAction runspaceChangeAction = RunspaceC
504
{
505
// If we're changing runspace, make sure we move the handlers over
506
RunspaceFrame previousRunspaceFrame = _runspaceStack.Peek();
507
- if (previousRunspaceFrame.Runspace != CurrentPowerShell.Runspace)
+ if (_psFrameStack.Count == 0 || previousRunspaceFrame.Runspace != CurrentPowerShell.Runspace)
508
509
_runspaceStack.Pop();
510
RunspaceFrame currentRunspaceFrame = _runspaceStack.Peek();
0 commit comments