-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
Steps to reproduce
try { } finally {
Write-Host Press ctrl c now
Start-Sleep 5
Write-Host You`'ll never see this one
}Evaluate the above script and press CTRL + C after the message is displayed.
Expected behavior
The entire finally block to complete.
Actual behavior
The finally block is cancelled when CTRL + C is pressed.
Environment data
Name Value
---- -----
PSVersion 7.0.0-preview.3
PSEdition Core
GitCommitId 7.0.0-preview.3
OS Microsoft Windows 10.0.18362
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
This also occurs on Windows PowerShell 5.1
Notes
If CTRL + C is pressed in the try block, additional key presses in the finally block will be correctly ignored. e.g.
try {
Write-Host Press ctrl c now
Start-Sleep 5
} finally {
Write-Host Try pressing it a bunch, won`'t do anything
Start-Sleep 5
Write-Host You`'ll actually see this one
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime