question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missed key presses and jumpy cursor in terminal when working remotely with high latency

See original GitHub issue

Does 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:

  1. Have a remote setup with high latency
  2. 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 shows gitcommit.
  • I type c f <space> <backspace> <backspace> d <space>, so I expect cd , but got cfd .

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:

  1. Some days it does not happen at all, sometimes I get these every 5 minutes.
  2. If I open e.g. iTerm on my Mac and ssh into the remote server, I do not have these issues.
  3. 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.
  4. 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.
  5. 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:open
  • Created 2 years ago
  • Reactions:14
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
SoftwareApecommented, Apr 26, 2022

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.

4reactions
pfaioncommented, Sep 10, 2021

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):

git rebase -i HEAD~3                          
fatal: invalid upstream 'HEADD~3'

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 of HEAD, 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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve mouse input lag over Remote Desktop connection
I use a lot of 3D applications (Blender, Unity, Unreal) that involve clicking and holding the middle mouse button and dragging around to...
Read more >
How to resolve common problems with Windows Remote ...
This troubleshooting guide aims to help in ruling out some of the most common causes for poor functionality.
Read more >
Troubleshooting Keyboard and Mouse issues (1429) - Teradici
When connecting to a remote session the keyboard and mouse do not work, the input is sporadic, the input lags, the cursor doesn't...
Read more >
Best Windows 10 commands to diagnose your Internet ...
Diagnosing an Internet connection in Windows can be a frustrating experience. To help with this, we have outlined six Windows 10 commands ...
Read more >
How to fix mouse cursor disappearing on Remote Desktop
A quick way I find of getting the cursor back is to press CTRL-ALT-END when in the remote session (same as CTRL-ALT-DEL on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found