Skip to content

Bump libghostty to vt-1.0.0 and accept any Zig 0.17.x - #796

Merged
dakra merged 2 commits into
mainfrom
chore/libghostty-vt-1.0.0
Nov 7, 2026
Merged

dakra merged 2 commits into
mainfrom
chore/libghostty-vt-1.0.0

Conversation

@dakra

@dakra dakra commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Pin the libghostty-vt 1.0.0 release tarball (4.5 MB, against 40 MB for the GitHub archive).
  • Adapt to the packed Style and to set_attributes replacing set_attribute.
  • Forward vtPrintAscii from the handler. Without it the build passes, but plain parsing ends up 14% slower than the old pin instead of 28% faster.
  • Replace the comint filter's applyAttr with Style.withAttribute, and take the ASCII path there too.
  • Accept any Zig 0.17.x, following upstream's rule. Homebrew's 0.17.1 builds again.
  • Apply zig fmt from 0.17.1, which rewrites @intFromEnum and @enumFromInt to the backing-int builtins.

Behaviour changes

  • More scrollback per byte. At the default 5 MB, styled output keeps 6,643 lines instead of 5,067 (+31%), and plain 6,873 instead of 6,565 (+5%). Redraw cost scales with retained rows, so styled floods at the cap redraw about 25% slower. At equal rows the bump is as fast or slightly faster.
  • Kitty. An image placed at the cursor after a shrink is drawn again.

Parse timings

ms per 1 MB, 8 randomized rounds, emacs --batch:

Case Old pin vt-1.0.0 Change
Plain 0.67 0.48 −28%
Styled 2.54 2.20 −13%
Unicode 0.96 0.91 −6%
Mixed emoji/CJK 2.32 2.49 +7%

Emacs-side rendering dominates end to end, so parse plus redraw moves only about −4% to +3%, apart from the styled case above.

Verification

  • make -j8 all passes on macOS arm64 with Zig 0.17.1 (1,533 ERT tests, Zig tests, lint).
  • New test ghostel-test-kitty-image-at-cursor-after-shrink fails on the old module and passes on the new one.
  • New test ghostel-comint-test-styled-run-after-mixed-text covers offsets across ASCII and multibyte text. It fails when the offset logic is deliberately broken.
  • Live elate session under zsh: combined SGR, truecolor, wave underline, background fills, OSC 8, CJK, a 20,000-line flood with no gaps, and the alternate screen through less.

Open points

  • backend/plain/native measured slower with the forwarder than without it in two runs (about 16 vs 13–14 ms, old pin about 15 ms). Unexplained.
  • Not built locally on Linux, Windows or Android, or with Zig 0.17.0. CI is the first run for all of those.
  • The kitty fix was checked at the module's display call, not by viewing an image in a GUI session.
  • The snapshot wire version is still 1, but upstream excludes the format from its ABI promise.

dakra added 2 commits November 7, 2026 09:05
Pin the libghostty-vt 1.0.0 release tarball, which is 4.5 MB against
40 MB for the GitHub archive.

Adapt to the packed Style and to set_attributes replacing
set_attribute.  Forward vtPrintAscii from the handler so the stream
keeps its ASCII fast path, and take that path in the comint filter.
Style.withAttribute replaces the filter's applyAttr copy, and
placeholderTarget now only returns virtual placements.

The build gate follows upstream's rule: same major and minor, and at
least the required patch.  Homebrew's Zig 0.17.1 builds again.  Its
zig fmt rewrites @intFromEnum and @enumFromInt to the backing-int
builtins, which exist in 0.17.0.
Release binaries were built with an older compiler than local
development uses, and 0.17.1 carries LLVM codegen fixes.

The pure-Zig unit test job stays on 0.17.0 so the minimum in
build.zig.zon keeps being compiled.
@dakra
dakra merged commit 4e07856 into main Nov 7, 2026
33 checks passed
@dakra
dakra deleted the chore/libghostty-vt-1.0.0 branch November 7, 2026 14:52

This branch was previously deployed

1 inactive deployment
github-pages — 4e07856e Deployed Nov 7, 2026 by dakra via deploy #255
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