Skip to content

Conversation

jborean93
Copy link
Contributor

@jborean93 jborean93 commented Jul 28, 2025

PR Summary

Updates the sequence of launching and attaching scripts until after
configuration done is received. This aligns the behviour of starting a
debug session with other debug adapters. A side effect of this change is
that it is now possible to set breakpoints and do other actions in an
attached runspace target during the initialisation.

Also adds a new option NotifyOnAttach for an attach request which will
create the PSES.Attached event before calling Debug-Runspace
allowing attached scripts to wait for an attach event.

PR Context

Fixes: #2191
Fixes: #2245

The changes include the commit from #2251 which includes some test runner changes and to verify all the recent stuff added by myself work properly. I'll take this out of draft once we know what is happening with #2251.

PR to document new option in vscode-powershell PowerShell/vscode-powershell#5249.

@jborean93
Copy link
Contributor Author

Also have opened PowerShell/PowerShell#25788 which adds an event and public API to determine when Debug-Runspace has attached itself to a Runspace. This will help provide an official public API for new PowerShell versions if attached but the proposed notifyAttach option here will be good for older PowerShell versions.

@jborean93 jborean93 force-pushed the set-configuration branch 4 times, most recently from 3b58a91 to 356885d Compare August 6, 2025 04:07
Updates the sequence of launching and attaching scripts until after
configuration done is received. This aligns the behaviour of starting a
debug session with other debug adapters. A side effect of this change is
that it is now possible to set breakpoints and do other actions in an
attached runspace target during the initialisation.

Also adds a new option `NotifyOnAttach` for an attach request which will
create the `PSES.Attached` event before calling `Debug-Runspace`
allowing attached scripts to wait for an attach event.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write event on configurationDone for attach requests Bring launch sequencing in line with DAP spec
1 participant