-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Description
Terminal.Gui uses System.Console
for its "least-common-denominator" console driver (NetDriver
).
We call System.Console.ReadKey
to process keyboard input.
We've noticed that the key info we get on Windows vs Linux is wildy different. Prior to dotnet7, both behaved the same (badly).
With dotnet7 & 8 Linux is WAY better.
For example, if the user presses "Ctrl+7", on Linux we get the right key info. On Windows we get [ConsoleKeyInfo(Key: Null (None), KeyChar: ␟ (31))]
.
For "Ctrl+7" we get [ConsoleKeyInfo(Key: Space, W (F8) | Control, KeyChar: ␀ (0))]
For reference, "Ctrl+A" works fine: [ConsoleKeyInfo(Key: A (A) | Control, KeyChar: a (65))]
Is there something we can do to make Windows work as well as Linux (what a strange thing to ask :-))?
Reproduction Steps
Using the v2_develop
branch of Terminal.Gui debug the UI Catalog -usc
in the VS debugger. This runs UI Catalog using the NetDriver
.
Open the Keys
scenario and press "Ctrl+7" (you might need to unbind that key from WT's actions).
Now run the WSL: UI Catalog -usc
debug profile. This runs UI Catalog in WSL using NetDriver.
Open Keys
and press "Ctrl+7". You'll see this:
Expected behavior
Actual behavior
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response