You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
On Linux, the KeyChar of the ConsoleKeyInfo returned from Ctrl+c becomes \0 with .NET 7-RC.1 #75795
This is a regression in .NET 7-RC1 to previous .NET versions, such as .NET 7-preview.7 and .NET 6
On Linux, with .NET 7-RC1, the ConsoleKeyInfo returned from Console.ReadKey($true) when pressing Ctrl+c has the value \0 for the KeyChar property. With the previous .NET versions. the value of KeyChar for the same operation is (char)3.
Note that, on Windows, with either .NET 7-RC1 or previous .NET versions, the value of KeyChar for the same operation is always (char)3.
This prevents Ctrl+c from working in PowerShell running on .NET 7-RC.1
Reproduction Steps
Using PowerShell 7.3.0-preview.8, which is built against .NET SDK 7.0.100-rc.1.22431.12, on Ubuntu 18.04.
The TERM env var is xterm-256color, but you get the same result when setting the TERM to rxvt.
For Ctrl+c, the returned ConsoleKeyInfo should have KeyChar with the value (char)3.
The TERM env var is xterm-256color
## This is the expected result when using .NET 7-preview.7 or .NET 6
PS:1> [console]::TreatControlCAsInput = $true
PS:2> $s = [console]::ReadKey($true)
PS:3> [int]$s.KeyChar
3
Activity
daxian-dbw commentedon Sep 17, 2022
/cc @adamsitnik for visibility.
SteveL-MSFT commentedon Sep 19, 2022
This issue blocks PS7.3 release with .NET7-rc1