Skip to content

fix: redraw terminal glyphs when Koko comes back into focus, and release 0.5.10 - #47

Merged
edalee merged 1 commit into
mainfrom
fix/terminal-glyph-atlas
Oct 8, 2026
Merged

edalee merged 1 commit into
mainfrom
fix/terminal-glyph-atlas

Conversation

@edalee

@edalee edalee commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

A terminal could show a whole screen of wrong letters, as in today's screenshot at 18:59. The layout stays right, but every glyph is wrong. This matches the WebGL glyph-atlas corruption that TerminalPane already works around (xtermjs/xterm.js#5847). The workaround cleared the atlas at most once a minute, and only while output streamed.

  • The terminal now redraws its glyphs when Koko's window regains focus or comes back into view, for example after sleep.
  • While output streams, it clears the atlas every 10 seconds, up from every 60.
  • The upstream fix (Fix webgl rendering corruption from atlas page merges xtermjs/xterm.js#5883) is merged, but it is only in the 6.1.0 and 0.20.0 betas, so this keeps the workaround on stable 6.0.0.
  • Version 0.5.10.

Test plan

  • typecheck, biome and vitest
  • After install: leave Koko, sleep the Mac, come back, and check the terminal text

A whole screen of wrong glyphs can follow sleep or a switch away, when
WKWebView drops GPU textures without a context loss. Also clear the atlas
every 10 seconds while output streams, and release 0.5.10.
@edalee
edalee merged commit ce81265 into main Oct 8, 2026
2 checks passed
edalee added a commit that referenced this pull request Oct 19, 2026
After a tab switch or a lost WebGL context, a pane could show only its
cursor while its content sat in the buffer. A scroll or a resize brought
it back.

- Repaint every row each time a pane becomes active, not only when its size changed.
- On a lost WebGL context, dispose the addon, repaint on the DOM renderer, and load WebGL again on the next activation.
- Redraw Terminal, the periodic atlas flush and the focus redraw from #47 share one repaint.
edalee added a commit that referenced this pull request Oct 19, 2026
After a tab switch or a lost WebGL context, a pane could show only its
cursor while its content sat in the buffer. A scroll or a resize brought
it back.

- Repaint every row each time a pane becomes active, not only when its size changed.
- On a lost WebGL context, dispose the addon, repaint on the DOM renderer, and load WebGL again on the next activation.
- Redraw Terminal, the periodic atlas flush and the focus redraw from #47 share one repaint.
edalee added a commit that referenced this pull request Oct 19, 2026
After a tab switch or a lost WebGL context, a pane could show only its
cursor while its content sat in the buffer. A scroll or a resize brought
it back.

- Repaint every row each time a pane becomes active, not only when its size changed.
- On a lost WebGL context, dispose the addon, repaint on the DOM renderer, and load WebGL again on the next activation.
- Redraw Terminal, the periodic atlas flush and the focus redraw from #47 share one repaint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant