Skip to content

Commit 28617c6

Browse files
committed
Reset Console.TreatControlCAsInput when prompt is cancelled
1 parent 6390ce7 commit 28617c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/PowerShellEditorServices/Console/ConsoleService.cs

+4
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ public void CancelReadLoop()
131131
{
132132
if (this.readLineCancellationToken != null)
133133
{
134+
// Set this to false so that Ctrl+C isn't trapped by any
135+
// lingering ReadKey
136+
Console.TreatControlCAsInput = false;
137+
134138
this.readLineCancellationToken.Cancel();
135139
this.readLineCancellationToken = null;
136140
}

0 commit comments

Comments
 (0)