Skip to content

An error occurred while calling python mscvrt module to retrieve characters from a vscode terminal (windows10 1903) #78682

@SummerGift

Description

@SummerGift

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 vscode terminal returns b'\x00' b'K'.
This problem didn't appear in the last version of Windows, and I wondered what to do about it.

  • VSCode Version: 1.36.1
  • OS Version: windows 10 1903

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

Does this issue occur when all extensions are disabled?: No

Thank you for your attention.

Metadata

Metadata

Assignees

Labels

terminalGeneral terminal issues that don't fall under another labelterminal-conptyIntegrated terminal issues related to the ConPTY backendupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions