-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Ctrl+Break should send a "Break All" message to the remote session and stop the running script in the remote script debugger. But instead the client hangs.
One issue is that the client never sends the Break All signal to the remote session because the server capabilities returned by the session is null, and Break All is implemented only for server sessions running PowerShell V5.0 or greater.
The hang issue seems to be related to SSH. Since its process is also attached to the console it also receives the Ctrl+Break event. The event doesn't terminate SSH client process like Ctrl+C does but it does something so that PSRP data messages no longer arrive at the PowerShell client even though the server PowerShell session continues to send PSRP data and command complete messages.
Need to find out why the remote session does not send server capabilities to client.
Need to find out how Ctrl+Break affects SSH client process.
Steps to reproduce
PS> Enter-PSSession -HostName <hostName> -UserName <userName>
[<hostName>]: PS> 1..100 | foreach { sleep 1; "Output $_" }
Output 1
Output 2
# while script is running type Ctrl+BreakExpected behavior
Running script should break into the remote debugger.
Actual behavior
Client hangs and never receives anymore PSRP messages from server session.
Environment data
Name Value
---- -----
SerializationVersion 1.1.0.1
GitCommitId v6.0.0-alpha.10-8-gdd2394b1e6088f6c82054f5cae5520e532010fd4-dirty
PSRemotingProtocolVersion 2.3
WSManStackVersion 3.0
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
CLRVersion
BuildVersion 3.0.0.0
PSVersion 6.0.0-alpha
PSEdition Core