Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal unexpected display #204690

Closed
nonprenom opened this issue Feb 8, 2024 · 19 comments · Fixed by #206537
Closed

Terminal unexpected display #204690

nonprenom opened this issue Feb 8, 2024 · 19 comments · Fixed by #206537
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-rendering verified Verification succeeded
Milestone

Comments

@nonprenom
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.85.2
  • OS Version: windows 10

Steps to Reproduce:

  1. give focus to a running terminal tab :
  • anti aliasing looks activated
  • there are spaces between the characters
    2 The terminal is running correctly
    3 to fix it, I can
  • close and reopen the terminal
  • change some settings of the terminal (curson blink on/off for example)

image

Now that i'm thinking about, maybe it's because I previously connect to my PC from remote RDP ?

Version: 1.85.2
Commit: 8b37750
Date: 2024-01-18T06:40:10.514Z
Electron: 25.9.7
ElectronBuildId: 26354273
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

@VSCodeTriageBot
Copy link
Collaborator

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.86.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@meganrogge meganrogge added the info-needed Issue requires more information from poster label Feb 9, 2024
@meganrogge
Copy link
Contributor

I cannot reproduce. Can you in insiders?

@mmastrac
Copy link
Contributor

mmastrac commented Feb 11, 2024

I see the same thing on Mac. It happens after VSCode has been running for a while. The only real setting I've tweaked is that I've set my scrollback to 25000.

Below is a screenshot of a newly opened terminal next to the old one, which will work fine for some time. Eventually they all become like this and I need to restart them.

Confirmed that toggling the cursor blink setting resets these terminals to a working state.

Version: 1.86.0
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:29:11.933Z (1 wk ago)
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 22.6.0
image

@mmastrac
Copy link
Contributor

Here's some debugging info, hopefully it helps.

I dumped the styles from the div that holds the terminal window: https://gist.github.com/mmastrac/faa9001068b56a3f05787100e15b94f8

<div class="terminal-widget-container"></div>

And from the xterm-rows div, styles https://gist.github.com/mmastrac/457fd04902bc62120f2c25f676446ea6:

<div class="xterm-rows" aria-hidden="true" style="line-height: normal; letter-spacing: 7.22222px;"><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>Enumerating objects: 17, done.</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>Counting objects: 100% (17/17), done.</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>Delta compression using up to 12 threads</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>Compressing objects: 100% (9/9), done.</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>Writing objects: 100% (9/9), 705 bytes | 705.</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>00 KiB/s, done.</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>Total 9 (delta 8), reused 0 (delta 0), pack-r</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>eused 0</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>remote: Resolving deltas: 100% (8/8), complet</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>ed with 8 local objects.</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>To https://github.com/mmastrac/deno.git</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>   d0c83ce1c..5228d029e  deno_core_bump -&gt; de</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span>no_core_bump</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span class="xterm-fg-2">✔</span><span> </span><span class="xterm-fg-3">~/Documents/github/deno/deno</span><span> [</span><span style="color:#c353c3;">deno_core_bum</span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span style="color:#c353c3;">p</span><span>|</span><span class="xterm-bold xterm-fg-12">⚑ 22</span><span>] </span></div><div style="width: 325px; height: 14px; line-height: 14px; overflow: hidden;"><span class="xterm-fg-7">1</span><span class="xterm-fg-7">6:06</span><span> $ </span><span class="xterm-cursor xterm-cursor-outline"> </span></div></div>

@mmastrac
Copy link
Contributor

mmastrac commented Feb 11, 2024

The problem appears to be this style. If I toggle the letter-spacing style rule, the terminal appears to be fixed:

image

I'm not sure why, but only the terminals that are in an accessible mode (why are some of them switching to be accessible?) seem to be broken.

@nonprenom
Copy link
Author

nonprenom commented Feb 12, 2024

@meganrogge
Can it be connected to a previous remote desktop connection to the PC running vscode ?
When connecting and disconnecting, the resolution change and, maybe, the terminal is not refresh correctly ?
@mmastrac Are you using such a remote desktop connection on your mac when it happend ?

@mmastrac
Copy link
Contributor

@nonprenom I'm not using any sort of remote desktop. It just appears that a terminal "rots" after being in the background long enough (maybe the laptop going to sleep?).

@adamhamlin
Copy link

Have had same issue for weeks

@meganrogge
Copy link
Contributor

What do you mean by terminals in accessible mode?

@nonprenom
Copy link
Author

nonprenom commented Feb 18, 2024

Hi So it happend to me often without RDP before or switching reslution - what can I save or check to help here ?

@mmastrac
Copy link
Contributor

What do you mean by terminals in accessible mode?

It appears the affected terminal is switching from a canvas/GPU renderer to an HTML renderer. There are a few accessibility messages scattered around the terminals that switch when browsing the DOM.

I am not sure how any of the terminal rendering code works, so that's just a guess that it's accessibility.

@meganrogge meganrogge added terminal-rendering and removed info-needed Issue requires more information from poster labels Feb 21, 2024
@Vectorrent
Copy link

Vectorrent commented Feb 27, 2024

I've been seeing this issue randomly for the better part of a year:
image
Not sure what causes it. It seems to occur with long-running terminal sessions, after some time has passed. In my case, they are training runs for machine learning.

I'm using Code-OSS on Arch Linux with x11.

This seems to happen more frequently when my system "freezes", for whatever reason. While doing ML, my system will often hang, as weights are written to disk, or big pages are swapped between memory/disk. During this time, my entire system becomes unresponsive, as those tasks take priority. It is EXTREMELY COMMON for this issue to occur just after that happens. Though it will only affect 1 or 2 terminals, typically; not all of them.

There's also an uncommon version of this bug, where the extra spaces are not distributed uniformly, as you see here. Instead, there might be 1 or 2 extra "columns" of spaces splitting the terminal, in random positions. But otherwise, the rest of the text looks fine - except for a few columns of whitespace.

@Tyriar
Copy link
Member

Tyriar commented Feb 28, 2024

The problem appears to be this style. If I toggle the letter-spacing style rule, the terminal appears to be fixed:

image I'm not sure why, but only the terminals that are in an accessible mode (why are some of them switching to be accessible?) seem to be broken.

This is new info for me, I was not aware of letter-spacing to looks like this. Perhaps something is going wrong here:

https://github.com/Tyriar/xterm.js/blob/8e015ebf872001352c8f382364f6d58048b7800b/src/browser/renderer/dom/DomRenderer.ts#L267-L272

@Tyriar Tyriar added the bug Issue identified by VS Code Team member as probable bug label Feb 28, 2024
@Tyriar Tyriar added this to the March 2024 milestone Feb 28, 2024
@mmastrac
Copy link
Contributor

@Tyriar Let me know if you'd like me to set a breakpoint somewhere and monitor a running instance. For now I'll try to set a breakpoint on that line and see if I can get you the cached W width.

@Tyriar
Copy link
Member

Tyriar commented Feb 29, 2024

Reproduced just now:

  1. 3 terminals showing
  2. switch from gpu accel on to off
  3. kill 2 terminals, the last one had the spaced wrong

image

Selection is showing wrong:

image

Width cache:

image

High letter spacing:

image

@Tyriar
Copy link
Member

Tyriar commented Feb 29, 2024

@Tyriar
Copy link
Member

Tyriar commented Feb 29, 2024

Width cache _flat:

image

@Tyriar
Copy link
Member

Tyriar commented Feb 29, 2024

xtermjs/xterm.js#4973 should fix it

@mmastrac
Copy link
Contributor

Thank you, @Tyriar. Appreciate the investigation and fix.

Tyriar added a commit that referenced this issue Feb 29, 2024
@Tyriar Tyriar mentioned this issue Feb 29, 2024
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Feb 29, 2024
@mjbvz mjbvz added the verified Verification succeeded label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-rendering verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants