Skip to content

Commit c6fdc6b

Browse files
committed
Improve detection of runspace changes
This change adds new behavior that makes the detection of sudden runspace changes much more reliable. These changes were particularly necessary for detecting when we start debugging a runspace in a remote session since we don't get a PushRunspace notifications when that happens. This change also improves how we gather the prompt string just after a command is executed.
1 parent abf5773 commit c6fdc6b

File tree

5 files changed

+491
-281
lines changed

5 files changed

+491
-281
lines changed

src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,9 @@ await this.SendEvent(
742742

743743
async void powerShellContext_RunspaceChanged(object sender, RunspaceChangedEventArgs e)
744744
{
745-
if (this.waitingForAttach && e.ChangeAction == RunspaceChangeAction.Enter && e.NewRunspace.IsAttached)
745+
if (this.waitingForAttach &&
746+
e.ChangeAction == RunspaceChangeAction.Enter &&
747+
e.NewRunspace.Context == RunspaceContext.DebuggedRunspace)
746748
{
747749
// Send the InitializedEvent so that the debugger will continue
748750
// sending configuration requests

0 commit comments

Comments
 (0)