microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.31k stars 28.9k forks source link

VS Code messes up console output #114157

Closed doctordns closed 3 years ago

doctordns commented 3 years ago

Issue Type: Bug

This MAY be a bug in the PowerShell extension, but when running Test-NetConnection, results in corrupted output to the terminal. If I run the following command by highlighting it in the editor and Run Selection get corrupted output like this:

Untitled Project

When complete the screen looks like this - losing almost all the output

2021-01-11_15-42-51

This does NOT happen in the console.

VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:34:46.910Z) OS version: Windows_NT x64 10.0.20270

System Info |Item|Value| |---|---| |CPUs|Intel(R) Xeon(R) CPU X5675 @ 3.07GHz (6 x 3059)| |GPU Status|2d_canvas: unavailable_software
flash_3d: disabled_software
flash_stage3d: disabled_software
flash_stage3d_baseline: disabled_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software| |Load (avg)|undefined| |Memory (System)|4.00GB (1.50GB free)| |Process Argv|--crash-reporter-id 4821c3df-5942-4d1d-9740-246f3e1e2943| |Screen Reader|no| |VM|0%|
Extensions (4) Extension|Author (truncated)|Version ---|---|--- vscode-drawio|hed|1.2.0 powershell|ms-|2020.6.0 code-spell-checker|str|1.10.2 markdown-all-in-one|yzh|3.4.0
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 openlogontheside:30221877 python383cf:30185419 pythonvspyt617cf:30237717 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30211401 wsl2promptcf:30224613 pythonvsdeb440cf:30242243 unusedprompt:30224610 folderexplorercf:30224615 openfilemenucf:30224648 Issue Type: Bug This MAY be a bug in the PowerShell extgension, but when running Test-NetConnection, results in corrupted output to the terminal. If I run the following command by highlighting it in the editor and **Run Selection** get corrupted output like this: VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:34:46.910Z) OS version: Windows_NT x64 10.0.20270
System Info |Item|Value| |---|---| |CPUs|Intel(R) Xeon(R) CPU X5675 @ 3.07GHz (6 x 3059)| |GPU Status|2d_canvas: unavailable_software
flash_3d: disabled_software
flash_stage3d: disabled_software
flash_stage3d_baseline: disabled_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software| |Load (avg)|undefined| |Memory (System)|4.00GB (1.50GB free)| |Process Argv|--crash-reporter-id 4821c3df-5942-4d1d-9740-246f3e1e2943| |Screen Reader|no| |VM|0%|
Extensions (4) Extension|Author (truncated)|Version ---|---|--- vscode-drawio|hed|1.2.0 powershell|ms-|2020.6.0 code-spell-checker|str|1.10.2 markdown-all-in-one|yzh|3.4.0
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 openlogontheside:30221877 python383cf:30185419 pythonvspyt617cf:30237717 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30211401 wsl2promptcf:30224613 pythonvsdeb440cf:30242243 unusedprompt:30224610 folderexplorercf:30224615 openfilemenucf:30224648 pythonvsded773:30236629 pythonvspyt600:30241727 ```
pythonvsded773:30236629 pythonvspyt600:30241727 ```
vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

doctordns commented 3 years ago

Thanks @vscodebot. Not sure, but it is a terrible bug that needs fixing. And even if it is a duplicate, you have closed the other report and I can't even comment on it. This bug still exists hence this issue

Tyriar commented 3 years ago

@doctordns can you check if this behaves differently when run inside Windows Terminal?

doctordns commented 3 years ago

I do not have windows terminal installed. This happens on no powershell console.

Do I need to install Terminal to fix this issue? Terminal is not an acceptable solution.

Tyriar commented 3 years ago

@doctordns just trying to root cause the issue so we can get it fixed, if it also reproduces in Windows Terminal then it's an issue with our shared dependency (conpty).

doctordns commented 3 years ago

I will figure out how to download and install the terminal and get back to you. This will take a few...

:-)

doctordns commented 3 years ago

Well - maybe I should have noted that the issue occurs on Server. Unless I am missing a magic incantation - the store does not seem to be in Server. And when I downloaded release from GitHub, there seems no way to install the MSIXBundle file. Do I have to load Visual Studio to compile the source code to use the terminal? :-)

Fortunately, there is a slightly different failure in Windows 10.

Here is what I see in VS Code if I run Test-NetConnection:

https://user-images.githubusercontent.com/3630329/105095472-9c163b00-5a9d-11eb-9f52-c69f6a5cfd9e.mp4

SInce the output is so weird an MP4 seemed a better way to show this issue.

As I kind of expected, if I run this from Terminal, i get the following output:

2021-01-19_21-26-20

Interestingly, the output in VSCode is different between Server and Win10. But both are borked.

Tyriar commented 3 years ago

@doctordns I tried locally and it works for me 🤔

Does this happen if you change the value of terminal.integrated.rendererType (try all 3), recreate the terminal and run it again? Maybe it's an issue with one renderer in particular.

doctordns commented 3 years ago

All three fail. I attach an MP4 showing the results

https://user-images.githubusercontent.com/3630329/105508849-c6960d00-5cc4-11eb-9ea7-12daa3a29b29.mp4

Tyriar commented 3 years ago

I see that you're using the powershell integrated console from the PS extension, does it happen in a regular pwsh shell? It should look like this:

image

doctordns commented 3 years ago

AHHHHHHHHHH

Yes - it works just fine in the "regular pwsh shell". :-)

So is that a bug with the extension then??

I have opened an issue on the extension too.

Tyriar commented 3 years ago

Seems like it, thanks for creating the issue 👍

/duplicate