When using node.exe in the VS Code terminal, a bug is encountered.
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: ηζ¬: 1.94.0 (system setup) ζδΊ€: d78a74bcdfad14d5d3b1b782f87255d802b57511 ζ₯ζ: 2024-10-02T13:08:12.626Z Electron: 30.5.1 ElectronBuildId: 10262041 Chromium: 124.0.6367.243 Node.js: 20.16.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.19045
- OS Version: Windows 10 22H2
- CPU: Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz 2.90 GHz
Steps to Reproduce:
- Copy this code:
m = new Map([
[1,2],
[3,4]
]);
iter = m.entries();
- Run
nodein the VSCode terminal (using cmd.exe), right-click the mouse, and paste the code in the terminal:
node version: v20.15.0
It's only happening in VS Code terminal; the system Command Prompt terminal is normal.
The bug does not occur when pasting this code:
m = new Map([[1,2],[3,4]]);
iter = m.entries();
can you describe the bug in words?
IE expectation vs actual
can you describe the bug in words?
When there are multiple lines of arrays in the code, pasting the code will cause the brackets at the end of the statement in the next line of the array to appear incorrectly in the previous line, causing the code to run incorrectly.
When pasting quickly and continuously, the probability of bugs appearing is very high.
m = new Map([
[1,2],
[3,4]
]);
iter = m.entries();
I tried it again just now, copying the code above, right-clicking and pasting it into the VSCode Command Prompt, and the error immediately appeared.
The brackets of the second statement appeared before the output of the first statement.
VSCode CMD:
VSCode PowerShell:
Apparently it's not cmd , ps and node 's fault, because no matter how many times I try, they are all normal in the OS:
System CMD:
System PowerShell
This issue seems to originate from an upstream component and is not something VSCode can fix by making a change to our code. As such, I will go ahead and close it. Please try to reproduce in Windows Terminal and report to microsoft/terminal with repro steps.
If you cannot reproduce in Windows Terminal, chances are it's fixed in a later version of Windows. You can read more about how we consume conpty here. Additionally, soon we plan on shipping conpty v2 with VS Code which should bring our behavior in line with Windows Terminal. Thanks for understanding.
/label upstream terminal-conpty windows