-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Add a way to see if a remote debugger has attached #21392
Copy link
Copy link
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtimeWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtimeWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary of the new feature / enhancement
As a user who may want to attach to an otherwise unattended process to debug it, I want to be able to pause execution in said unattended process until I'm able to attach to it.
Proposed technical implementation details (optional)
A common pattern in C# for this would be something like
Currently in PowerShell there's no supported way to tell if a debugger is attached to the current runspace. A minimal way to enable this scenario would be a property on
Runspace:public partial abstract class Runspace { + public bool IsRemoteDebuggerAttached { get; } }This would allow the user to write the code
If there is sufficient demand for it, a command or method to wait for attach can also be considered, but to start off the proposal I'd recommend this as an MVP.
One question that I would suggest be answered in the WG decision is: "What should a remote runspace do for this parameter? Throw? Or always return false?"