Missed key presses and jumpy cursor in terminal when working remotely with high latency
See original GitHub issueDoes this issue occur when all extensions are disabled?: Yes
Note: VSCode Remote Development does not seem to work when starting with extensions disabled. Instead, I used Extension Bisect (which does not seem to disable the remote extension) and the result was that the issue still occurs with all (other) extensions disabled.
- VS Code Version: 1.57.0
- OS Version: macOS Catalina 10.15.7 (Darwin x64 19.6.0)
Context I work fully remotely with VSCode Remote Development via SSH. The servers of my company are on the other side of the globe, so I have some natural SSH lag when working. Sometimes there are spikes where the latency gets higher, in these moments I sometimes get incorrectly rendered text in the integrated terminal in VSCode.
Steps to Reproduce:
- Have a remote setup with high latency
- Type quickly in the terminal
Expected Result: The terminal should show the exact result of the key sequence I typed (probably after a delay).
Actual Result: Sometimes the terminal is missing a character (key press did not render) or erroneously shows a deleted character (backspace did not render). Some examples I had today:
- I type
git commit
and the terminal showsgitcommit
. - I type
c
f
<space>
<backspace>
<backspace>
d
<space>
, so I expectcd
, but gotcfd
.
If I reload the window, the terminal will actually display the correct text, so the key presses were registered and sent to the shell correctly! Just the rendering in the integrated terminal is bugged!
Further insights from my investigations:
- Some days it does not happen at all, sometimes I get these every 5 minutes.
- If I open e.g. iTerm on my Mac and ssh into the remote server, I do not have these issues.
- Since I have a complex ZSH setup with many plugins, I checked that the problem also happens with a stock bash shell in the integrated terminal. It seems to happen less often, but it also happened.
- After the initial bug, continuing to use the terminal will lead to all kinds of weirdnesses, e.g. I was able to “delete” my prompt lead character by hitting backspace afterwards.
- I have this issue already since I started working remotely (8 months), but hoped that others have the same problem and it would get fixed. But here I am now writing this report.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:14
- Comments:6 (1 by maintainers)
Top GitHub Comments
Please please make this the default until the feature is confirmed to work. Also maybe that suggestion about eventual consistency should be implemented that @pfaion suggested, i.e. render the estimated contents until you have the real contents. There should be only a single source of truth here.
What I feared in my previous response actually just happened!
Here’s another really bad example of this (this is from a different machine, where I forgot to set up the
localEchoLatencyThreshold
fix):While I typed
git rebase -i HEAD~3
, I made a typo and quickly corrected it.And in the terminal now it looked correct!!!
But as you can see in the response, it actually had
HEADD
instead ofHEAD
, but I would not see this!As you can see, this can produce extreme security risks, because you end up executing different code than what you see! Please consider changing this behavior to not be the default, fix it with better prediction or update the output continuously!