TerminalControl handles ALT+NUMPAD input poorly #1870

Open
opened 2026-01-30 22:40:34 +00:00 by claunia · 0 comments
Owner

Originally created by @leoniDEV on GitHub (Jun 22, 2019).

Originally assigned to: @leonMSFT on GitHub.

When the user enters Alt-123 it looks like we're doing this:

  • Sending ESC 1
  • Sending 2
  • Sending 3
  • Sending whichever character Alt-123 corresponds to.

Powershell and bash (readline) interpret alt-number as "enter digit-argument mode." Digit argument mode usually means "repeat the first character N times" ... so this results in character 123 being added to the buffer 123 times.

We should definitely fix that.

original content

Environment

Windows build number: 10.0.18922.1000 and 10.0.18362.175
Windows Terminal version (if applicable): 0.2.1715.0

Any other software?
Powershell Core 7.0.0-preview.1
Powershell Core 6.2.1
Windows Powershell 5.1

Steps to reproduce

  • Open Powershell (whatever version listed above) session in the Terminal
  • try to insert an ascii char by:
    • press and hold ALT key
    • digit whatever number (for example 126 corresponding to ~)

Expected behavior

a tilde (~) is inserted
WinTerPS7ok

Actual behavior

127 tildes are inserted
WinTerPS7

The same thing happens for all the versions of Powershell listed above

Originally created by @leoniDEV on GitHub (Jun 22, 2019). Originally assigned to: @leonMSFT on GitHub. When the user enters <kbd>Alt-123</kbd> it looks like we're doing this: * Sending `ESC` `1` * Sending `2` * Sending `3` * Sending whichever character <kbd>Alt-123</kbd> corresponds to. Powershell and bash (readline) interpret alt-number as "enter digit-argument mode." Digit argument mode usually means "repeat the first character N times" ... so this results in character `123` being added to the buffer 123 times. We should definitely fix that. # original content ## Environment ``` Windows build number: 10.0.18922.1000 and 10.0.18362.175 Windows Terminal version (if applicable): 0.2.1715.0 Any other software? Powershell Core 7.0.0-preview.1 Powershell Core 6.2.1 Windows Powershell 5.1 ``` ## Steps to reproduce - Open Powershell (whatever version listed above) session in the Terminal - try to insert an ascii char by: - press and hold `ALT` key - digit whatever number (for example 126 corresponding to `~`) ## Expected behavior a tilde (`~`) is inserted ![WinTerPS7ok](https://user-images.githubusercontent.com/11667486/59962852-317cd200-94eb-11e9-899c-bbdbd70087e5.png) ## Actual behavior 127 tildes are inserted ![WinTerPS7](https://user-images.githubusercontent.com/11667486/59962859-43f70b80-94eb-11e9-9f20-83f6d0938434.png) <!-- What's actually happening? --> The same thing happens for all the versions of Powershell listed above
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1870