-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console.ReadKey()
doesn't work for keys from the numeric keypad in the PuTTY ssh client
#25735
Comments
@eiriktsarpalis can it be related to #802 ? |
It seems very likely, though we'd probably need to test putty just to be sure. @daxian-dbw Am I right to assume this doesn't occur using a different terminal and ssh? |
@daxian-dbw ping |
Sorry for missing the comments here.
I presume so. There were similar reports in PowerShell repo, but all had Putty as the ssh client. |
Some test results: I upgraded powershell to the current latest version (7.0.2) on the linux box. Then I logged on using PuTTY and typed
This results in:
Using WSL2 Debian in Windows Terminal, all three cases produce Next I checked Emacs (because it has specific names for various keys), in console mode using PuTTY. Using WSL2 Debian, it sees My guess is: most Linux apps use termcap/terminfo/readline, which include remappings for some escape sequences. So their input methods translate things like |
I do not know much about terminals, but it looks like .NET app is using DECKPAM command to enter "Keypad application mode", but it is NOT using DECKPNM to enter "Keypad Numeric mode" again. This is the relevant strace:
This command can be used to enter "Keypad Numeric mode" again:
|
I don't know why, but every Terminal other that PuTTy working in application mode: recognizes pressing Num Lock as toggling Numeric Keypad mode ( The good news is that there is a setting that controls this behavior: https://boerlowie.wordpress.com/2010/08/26/get-numlock-working-in-putty/ #72193 is going to fix this issue (the Numeric Keypad keys are going to be properly recognized), but to use Numeric Keypad and Num Lock the PuTTy users are going to need to apply the setting described in the blog post referenced above: |
Original issue: PowerShell/PowerShell#10511
We got report that when ssh from PuTTY to a Linux machine and start
pwsh
on the server side,pwsh
doesn't support the numeric keypad.It turns out to be an issue with
Console.ReadKey
and the PuTTY client, see PowerShell/PowerShell#10511 (comment). Quoted below:The text was updated successfully, but these errors were encountered: