vscode: Local Echo breaks docker exec printout

Issue Type: Bug

  1. Create a WSL2 setup using Ubuntu 20.04 as the client OS and Docker Desktop 2.5.0 in WSL2 mode. (Unsure if this is required but this is my setup)
  2. Load your vscode inside your WSL2 guest, then start a terminal session.
  3. Run a docker image: docker run --rm -it node:14.15.0-alpine sh
  4. Try something like ls /, you would get this:

image

  1. Go to settings.json and turn off local echo: "terminal.integrated.localEchoLatencyThreshold": -1
  2. In my case the terminal refreshes immediately and I can now see the correct contents of the terminal:

image

Note: I tried with docker run --rm -it alpine sh and could not reproduce this bug, but the fact that local echo seems to be a proximate cause seems worth investigating.

VS Code version: Code 1.51.0 (fcac248b077b55bae4ba5bab613fd6e9156c2f0c, 2020-11-05T18:18:23.642Z) OS version: Windows_NT x64 10.0.19042 Remote OS version: Linux x64 4.19.104-microsoft-standard

System Info
Item Value
CPUs Intel® Core™ i7-10710U CPU @ 1.10GHz (12 x 1608)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.76GB (4.62GB free)
Process Argv –crash-reporter-id 6a21a6e0-2ac5-446e-88c1-ad7f0b95572d
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 4.19.104-microsoft-standard
CPUs Intel® Core™ i7-10710U CPU @ 1.10GHz (12 x 1608)
Memory (System) 3.84GB (1.42GB free)
VM 0%
Extensions (25)
Extension Author (truncated) Version
vscode-docker ms- 1.7.0
remote-containers ms- 0.148.0
remote-wsl ms- 0.51.1
debugger-for-edge msj 1.0.15
sql-bigquery shi 1.4.0
vim vsc 1.17.1
vscode-npm-script eg2 0.3.13
go gol 0.18.1
terraform has 2.2.3
vscode-docker ms- 1.7.0
python ms- 2020.10.332292344
vscode-typescript-tslint-plugin ms- 1.2.3
vsliveshare ms- 1.0.3121
vetur oct 0.29.1
java red 0.70.0
vscode-xml red 0.13.0
vscode-yaml red 0.12.0
trailing-spaces sha 0.3.1
vscode-scss-formatter sib 2.0.2
vscodeintellicode Vis 1.2.10
vscode-java-debug vsc 0.29.0
vscode-java-dependency vsc 0.14.0
vscode-java-pack vsc 0.10.0
vscode-java-test vsc 0.26.0
vscode-maven vsc 0.25.0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 20 (8 by maintainers)

Most upvoted comments

I’m seeing this on Mac (Catalina, 10.15.7) as well.

I’m shelled into a kubernetes container on AKS, and when I issue commands like “ls”, I see one of three things:

  • the expected output
  • no output at all
  • a blank line

Resizing the VSCode window (and hence the terminal) causes the missing text to appear. I just started noticing it today; it’s possible that the reason I just noticed it today was because I restarted VSCode for the first time in a week or two.

Version: 1.51.0 Commit: fcac248b077b55bae4ba5bab613fd6e9156c2f0c Date: 2020-11-05T18:14:40.758Z (4 days ago) Electron: 9.3.3 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Darwin x64 19.6.0

Log running the command in wsl2/ubuntu where the problem happens:

predict: "\u001b[2ml\u001b[22m"
VM371:1 predict: "\u001b[2ms\u001b[22m"
VM372:1 predict: "\u001b[2m \u001b[22m"
VM373:1 predict: "\u001b[2m/\u001b[22m"
VM374:1 before: "ls /"
VM375:1 after: "ls /"
VM376:1 predict: "\r\n"
VM377:1 before: "\r\n\u001b[1;34mbin\u001b[m    \u001b[1;34mdev\u001b[m    \u001b[1;34metc\u001b[m    \u001b[1;34mhome\u001b[m   \u001b[1;34mlib\u001b[m    \u001b[1;34mmedia\u001b[m  \u001b[1;34mmnt\u001b[m    \u001b[1;34mopt\u001b[m    \u001b[1;34mproc\u001b[m   \u001b[1;34mroot\u001b[m   \u001b[1;34mrun\u001b[m    \u001b[1;34msbin\u001b[m   \u001b[1;34msrv\u001b[m    \u001b[1;34msys\u001b[m    \u001b[1;34mtmp\u001b[m    \u001b[1;34musr\u001b[m    \u001b[1;34mvar\u001b[m\r\n/ # \u001b[6n"
VM378:1 after: "\u001b[?25l\u001b[1;34mbin\u001b[m    \u001b[1;34mdev\u001b[m    \u001b[1;34metc\u001b[m    \u001b[1;34mhome\u001b[m   \u001b[1;34mlib\u001b[m    \u001b[1;34mmedia\u001b[m  \u001b[1;34mmnt\u001b[m    \u001b[1;34mopt\u001b[m    \u001b[1;34mproc\u001b[m   \u001b[1;34mroot\u001b[m   \u001b[1;34mrun\u001b[m    \u001b[1;34msbin\u001b[m   \u001b[1;34msrv\u001b[m    \u001b[1;34msys\u001b[m    \u001b[1;34mtmp\u001b[m    \u001b[1;34musr\u001b[m    \u001b[1;34mvar\u001b[m\r\n/ # \u001b[6n\u001b[?25h"

Log running it through powershell:

predict: "\u001b[2ml\u001b[22m"
VM219:1 predict: "\u001b[2ms\u001b[22m"
VM220:1 predict: "\u001b[2m \u001b[22m"
VM221:1 predict: "\u001b[2m/\u001b[22m"
VM222:1 before: "l"
VM223:1 after: "\u001b[?25l\u001b[9;5Hl\u001b[9;9H\u001b[?25h"
VM224:1 before: "s /"
VM225:1 after: "\u001b[?25l\u001b[9;6Hs\u001b[9;7H \u001b[9;8H/\u001b[9;9H\u001b[?25h"
VM226:1 predict: "\r\n"
VM227:1 before: "\r\n"
VM228:1 after: ""
VM229:1 before: "\u001b[1m\u001b[94mbin\u001b[m    \u001b[1m\u001b[94mdev\u001b[m    \u001b[1m\u001b[94metc\u001b[m    \u001b[1m\u001b[94mhome\u001b[m   \u001b[1m\u001b[94mlib\u001b[m    \u001b[1m\u001b[94mmedia\u001b[m  \u001b[1m\u001b[94mmnt\u001b[m    \u001b[1m\u001b[94mopt\u001b[m    \u001b[1m\u001b[94mproc\u001b[m   \u001b[1m\u001b[94mroot\u001b[m   \u001b[1m\u001b[94mrun\u001b[m    \u001b[1m\u001b[94msbin\u001b[m   \u001b[1m\u001b[94msrv\u001b[m    \u001b[1m\u001b[94msys\u001b[m    \u001b[1m\u001b[94mtmp\u001b[m    \u001b[1m\u001b[94musr\u001b[m    \u001b[1m\u001b[94mvar\u001b[m\r\n/ # \u001b[111X"
VM230:1 after: "\u001b[1m\u001b[94mbin\u001b[m    \u001b[1m\u001b[94mdev\u001b[m    \u001b[1m\u001b[94metc\u001b[m    \u001b[1m\u001b[94mhome\u001b[m   \u001b[1m\u001b[94mlib\u001b[m    \u001b[1m\u001b[94mmedia\u001b[m  \u001b[1m\u001b[94mmnt\u001b[m    \u001b[1m\u001b[94mopt\u001b[m    \u001b[1m\

Seems roughly equivalent, just broken up into different chunks and with slightly different data attributes. Also, in the former case, the write is wrapped with a hide/show cursor sequence since predictions are participating in the output.

OK, I tried to screencap what I’m seeing and it’s truly weird. I wanted to show the contents of the terminal returning when I disabled local echo, but instead I found that as soon as I opened settings.json in a pane, they came back right away!

My guess is that the bug will happen or not base on whether local echo triggers, so based on the threshold it may happen some times and not others. No clue as to why opening settings.json (without changing the setting) fixes things though.

Video