Xterm.js: Demo rendering appears to be broken

Created on 1 May 2018  路  8Comments  路  Source: xtermjs/xterm.js

Loading and then pressing enter looks like it's drawing the text at 50% alpha or something.

screen shot 2018-04-30 at 3 11 50 pm

Reproing on my fork's master branch which is up to date with upstream.

typbug

Most helpful comment

I think I might know what's causing this:

  • TextRenderLayer doesn't wrap foreground drawChar calls in a save()/restore().
  • BaseRenderLayer's drawChar doesn't do a save()/restore() itself (which it probably should).
  • drawChar sets the globalAlpha when drawing a dim character.

I can experiment with trying to repro and fix this after work.

All 8 comments

This only happens sometimes :confused: I haven't seen it for a while now

Could be caused by default background color? https://github.com/Microsoft/vscode/issues/49438#issuecomment-387583242

I think I might know what's causing this:

  • TextRenderLayer doesn't wrap foreground drawChar calls in a save()/restore().
  • BaseRenderLayer's drawChar doesn't do a save()/restore() itself (which it probably should).
  • drawChar sets the globalAlpha when drawing a dim character.

I can experiment with trying to repro and fix this after work.

I think this is still happening, just synced with VS Code and I see this again

image

allowTransparency = false
background = #ffffff

It's also using the static cache.

Can repo on the demo by changing this:

https://github.com/xtermjs/xterm.js/blob/0ad108013399bd1e7a82a82fb9079db7a45107a9/demo/main.js#L113-L119

To:

term = new Terminal({});

Disabling any one of these settings (such that there are 4 properties) will cause the repo :confused:

  term = new Terminal({
    macOptionIsMeta: optionElements.macOptionIsMeta.enabled,
    cursorBlink: optionElements.cursorBlink.checked,
    scrollback: parseInt(optionElements.scrollback.value, 10),
    tabStopWidth: parseInt(optionElements.tabstopwidth.value, 10),
    screenReaderMode: optionElements.screenReaderMode.checked
  });

The same fix as https://github.com/xtermjs/xterm.js/pull/1442 needs to be applied to the static char atlas. We should do this for 3.4.1 as the static cache is the default.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

goxr3plus picture goxr3plus  路  3Comments

jerch picture jerch  路  3Comments

chris-tse picture chris-tse  路  4Comments

kolbe picture kolbe  路  3Comments

tandatle picture tandatle  路  3Comments