Merge upstream ghostty v1.4.0 (Zig 0.17)

Merged
LA
9d ago
+37088-13131

Merges upstream tag v1.4.0 (83fb95624, 2026-10-27) into main with a merge commit (no rebase; every pinned commit stays an ancestor). next/UPSTREAM_BASE moves f96c9711b -> 83fb95624; next/toolchain.env pins Zig 0.17.0 (upstream 1.4.0 needs it). Flavor stays apple-v6.

Every conflict (45 files) and its resolution is in NEXT.md, section "Upstream sync to v1.4.0". Highlights:

  • Dropped: the OSC 7501 port (upstream ships it; GHOSTTY_TERMINAL_OPT_PROGRAM_STATUS is upstream's 46 again). Hidden GPU release (c4e16970a) and display link sleep (6688aa072) were already in the old base.
  • libghostty-vt ABI: upstream took options 44-47; the fork's four options move to 1024-1027 so they never collide again. cmux-tui reads names via bindgen, so a rebuild is enough.
  • Kitty ImageStorage.dirty is upstream's counter; the C API keeps its bool contract.
  • The iOS CADisplayLink follows upstream's main-thread DisplayLink surface (ffaaf5d7a).
  • deps mirror unused: upstream moved those deps to new versions on deps.files.ghostty.org.

Tests (Linux x86_64, Zig 0.17.0, Debug): zig build test -Dapp-runtime=none 4189 passed / 44 skipped / 0 failed; zig build test-lib-vt 7038 passed / 76 skipped / 0 failed.

Not run locally: the macOS and iOS slices (Metal, CVDisplayLink, CADisplayLink) — this PR's next-xcframework.yml run builds and smokes them.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Merges upstream Ghostty v1.4.0 (83fb95624) into main as a merge commit so pinned commits stay ancestors. Pins Zig 0.17.0, which upstream now requires; flavor stays apple-v6.

Key changes

  • Cherry-picked fixes: unknown-source links are now untrusted, macOS refuses to execute files with control characters in their path, paste protection treats carriage returns like newlines, and a cursor page use-after-free is fixed when scrollback prunes it.
  • macOS CVDisplayLink now starts and stops on the main thread, fixing an app freeze; iOS follows upstream's main-thread DisplayLink surface. Resizing holds the terminal lock before resizing the pty so SIGWINCH redraws can't race the new dimensions.
  • VT formatter output now emits cell hyperlinks as OSC 8, restores blank cells and erased backgrounds, and keeps trailing blank rows when trimming is off.
  • OSC context signal is renamed hierarchical context (HC), and Kitty shared memory accepts names without a leading slash.
  • Terminal conformance fixes: CUB/BS stop at the left margin, CHA/VPA/HPR/VPR stay origin-relative, mouse releases on tracked prompts now reach the program, and button 11 no longer overruns the click-state array.
  • libghostty-vt ABI: upstream took terminal options 44–47, so the fork's four options move to 1024–1027; rebuilding cmux-tui suffices. The OSC 7501 port is dropped; upstream's option 46 provides program status again.
  • GTK now requires GTK 4.18 and libadwaita 1.7, adding a close-button position option, IME cursor position during preedit, notification clearing, and a progress bar pulse stop. macOS AppleScript gains a tab/terminal name override property, and surfaces get pasteText honoring paste protection.
  • Nix and flatpak builds are updated for Zig 0.17, including an iOS cross-compile patch, a Homebrew-Zig priority fix, and a snapshot/grid corruption panic fix; FreeBSD VM test scripts and a -Dinstalled-exe-path Linux packaging option are added. All conflict resolutions are in NEXT.md under "Upstream sync to v1.4.0".

Testing

  • Linux x86_64 on Zig 0.17.0: zig build test -Dapp-runtime=none 4189 passed / 44 skipped / 0 failed; zig build test-lib-vt 7038 passed / 76 skipped / 0 failed.
  • macOS and iOS slices weren't run locally; next-xcframework.yml builds and smokes them.