ConPTY does not translate arrow keys with +ENHANCED_KEY in their modifiers #3361

Open
opened 2026-01-30 23:19:32 +00:00 by claunia · 0 comments
Owner

Originally created by @SummerGift on GitHub (Aug 12, 2019).

Originally assigned to: @carlos-zamora on GitHub.

Today I updated Windows to 1903 and found that a python program I had written earlier ran incorrectly.

The brief test code is as follows:

import msvcrt
ch1 = msvcrt.getch()
ch2 = msvcrt.getch()
print(ch1)
print(ch2)

When I run the above code in native powershell, press ← key when collecting characters, and it will print b'\xe0' B 'K', and the same code running in the terminal returns b'\x00' b'K'.
This problem didn't appear in the last version of Windows (18.xx).

Steps to Reproduce:

  1. Run this code on the powershell terminal of vscode using Python3
  2. press ← key,record print information
  3. Run this code directly from your powershell on Windows using Python3
  4. press ← key,record print information
  5. Look at different outputs

A related issue on vscode:

https://github.com/microsoft/vscode/issues/78682

Thank you for your attention.

Originally created by @SummerGift on GitHub (Aug 12, 2019). Originally assigned to: @carlos-zamora on GitHub. Today I updated Windows to 1903 and found that a python program I had written earlier ran incorrectly. The brief test code is as follows: ``` import msvcrt ch1 = msvcrt.getch() ch2 = msvcrt.getch() print(ch1) print(ch2) ``` When I run the above code in native powershell, press ← key when collecting characters, and it will print `b'\xe0' B 'K'`, and the same code running in the terminal returns `b'\x00' b'K'`. This problem didn't appear in the last version of Windows (18.xx). - OS Version: windows 10 1903 - [terminal version](https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701?activetab=pivot:overviewtab) : preview Steps to Reproduce: 1. Run this code on the powershell terminal of vscode using Python3 2. press ← key,record print information 3. Run this code directly from your powershell on Windows using Python3 4. press ← key,record print information 5. Look at different outputs A related issue on vscode: https://github.com/microsoft/vscode/issues/78682 Thank you for your attention.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3361