-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Interactive-Debuggingdebugging PowerShell scriptdebugging PowerShell script
Description
Steps to reproduce
Open 2 PowerShell windows of the same version
create a file foo.ps1 that looks like this:
"hello"
Start-Sleep -Seconds 20
"boo"In PowerShell one
PS > $pid | scbIn PowerShell two
PS > Enter-PSHostProcess -Id <PASTE>In PowerShell one
PS > . .\foo.ps1Hurry up and run In PowerShell two:
[Process: 2345] PS > Debug-Runspace 1Expected behavior
This happens in Windows PowerShell
Debugging Runspace: Runspace1
To end the debugging session type the 'Detach' command at the debugger prompt, or type 'Ctrl+C' otherwise.
At C:\Users\tyleonha\Downloads\foo.ps1:3 char:1
+ "boo"
+ ~~~~~
[DBG]: [Process:30956]: [Runspace1]: PS C:\Users\tyleonha\Downloads>>
Actual behavior
This happens in PowerShell 7. Note it does not break into a debug prompt.
Debugging Runspace: Runspace1
To end the debugging session type the 'Detach' command at the debugger prompt, or type 'Ctrl+C' otherwise.
Command or script completed.
To end the debugging session type the 'Detach' command at the debugger prompt, or type 'Ctrl+C' otherwise.
Thoughts
Frankly I'm suspicious of my own PR way back when #11312 that changed this behavior. This parameter -BreakAll mentioned here:
#13527
should probably be -NoBreakAll or have some way to have it on by default and allow you to opt out. This will allow for backcompat for Windows PowerShell and the ability to toggle BreakAll.
Environment data
Name Value
---- -----
GitCommitId 7.1.0-daily.20200430
PSVersion 7.1.0-daily.20200430
WSManStackVersion 3.0
Platform Unix
SerializationVersion 1.1.0.1
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
OS Darwin 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64
PSRemotingProtocolVersion 2.3
PSEdition Core
Although this bug existed in 7.0...
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Interactive-Debuggingdebugging PowerShell scriptdebugging PowerShell script