You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Display density changes lead to corrupted characters #2137
When switching between a built-in Retina display and an external normal-density display, some characters will be drawn with incorrect size by the canvas renderer.
Now, I can't confirm whether it's possibly Electron's fault, but I suspect that Chrome would behave the same.
Cannot repro this and the other issue #2135 (on Ubuntu though, with Fira Mono and ligatures enabled).
Kinda sounds as the dpr change gets not applied? @Eugeny Could you test, if the demo shows the same wrongly scaled glyphs when you switch the screens?
Still reliably reproducible in master with the webgl renderer:
The font doesn't get corrupted immediately after the DPI switch, but rather after font-family and font-size are updated (re-set to the same values) in xterm.
@jerch@Tyriar
I came from the VS Code issue microsoft/vscode#94656
It can be reliably reproduced reliably on my macOS 10.15.3 with VS Code 1.44.2 and enabled the experimentalWebgl renderer type.
I have two displays show below
Keep the external display connected.
Open the Terminal if it hasn't been.
Move the VS Code to the external display if it hasn't been.
Disconnect the external display.
The VS Code will be moved to the builtin display automatically.
@Tyriar in case this helps, it can be reliably reproduced with the demo page, but only for unicode characters. ASCII will get occasionally corrupted, but not always.
Changing font size to something else and back immediately fixes it.
Activity
Tyriar commentedon May 28, 2019
Might be rel;ated to ligature problems in #2135?
Eugeny commentedon May 28, 2019
Might be, but I don't think so. Looks like some chars might be cached in the renderer atlas with a smaller resolution?
Tyriar commentedon May 28, 2019
@Eugeny seems to me like the cached parts are
-r,-xand--.Eugeny commentedon May 28, 2019
Good point - these are the ones that are incorrectly rendered in #2135
Eugeny commentedon May 28, 2019
Weirdly enough, switching to a higher density makes these characters larger, and switching to a smaller density display makes them smaller.
Tyriar commentedon May 28, 2019
The APIs that https://github.com/xtermjs/xterm-addon-ligatures use probably just need some updating for the recent updates to renderers.
jerch commentedon May 28, 2019
Cannot repro this and the other issue #2135 (on Ubuntu though, with Fira Mono and ligatures enabled).
Kinda sounds as the dpr change gets not applied? @Eugeny Could you test, if the demo shows the same wrongly scaled glyphs when you switch the screens?
Eugeny commentedon Jun 25, 2019
Still reliably reproducible in master with the webgl renderer:

The font doesn't get corrupted immediately after the DPI switch, but rather after font-family and font-size are updated (re-set to the same values) in xterm.
yuezk commentedon Apr 20, 2020
@jerch @Tyriar
I came from the VS Code issue microsoft/vscode#94656
It can be reliably reproduced reliably on my macOS 10.15.3 with VS Code 1.44.2 and enabled the
experimentalWebglrenderer type.I have two displays show below

Terminalif it hasn't been.Tyriar commentedon Apr 20, 2020
I've seen this happen a bunch, we're probably just missing a case in https://github.com/xtermjs/xterm.js/blob/master/src/browser/ScreenDprMonitor.ts, or something is not listening to the monitor.
Eugeny commentedon May 2, 2020
@Tyriar in case this helps, it can be reliably reproduced with the demo page, but only for unicode characters. ASCII will get occasionally corrupted, but not always.
Changing font size to something else and back immediately fixes it.
jerch commentedon May 2, 2020
@Eugeny Could you test if this can be repro'ed for ASCII as well, if the fg color is set to RGB?
I suspect that
_drawUncachedCharsdoes not get the DPR changes for some reason.Eugeny commentedon May 2, 2020
@jerch I've just pushed a PR with the fix. The listener wasn't being called at all.