Repository navigation
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
There was a problem hiding this comment.
Requesting changes; I could not build or test it here because this environment has no Rust or Zig toolchain. I checked the regenerated bindings and mod.rs against Ghostty's terminal.h at both revisions.
Public API: unchanged (internal FFI and CI only).
Main concern: the scrollback limit switches from bytes to lines. At the old pin, max_scrollback ended up in Screen.max_scrollback, which counts bytes, even though the old header calls it a line count. The daemon passes replay_capacity, a byte budget. Setting SCROLLBACK_MAX_LINES to that value lets each terminal keep about 2 million lines instead of about 2 MiB. GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_BYTES keeps the current behaviour (see inline).
Also, if that ghostty_terminal_set call fails, the native terminal is never freed (inline). And packages/process-daemon/README.md still says to install Zig 0.16.0 and describes the Zig 0.16 ARM64 alignment fix this PR removes; the src/musl.rs comment also refers to Zig 0.16. Please update them with the bump.
There was a problem hiding this comment.
The new push is only a merge of dev; it doesn't change any of this pull request's files. My earlier inline point is still open: the byte budget is now set as a line limit (SCROLLBACK_MAX_LINES instead of SCROLLBACK_MAX_BYTES), and the native terminal leaks if that ghostty_terminal_set call fails. The stale Zig 0.16 notes in packages/process-daemon/README.md and the src/musl.rs comment are also unchanged. Public API: unchanged. I still couldn't build or test it here (no Rust or Zig toolchain).
Ghostty 1.4.0 requires Zig 0.17.0, which is the version the TUI already uses for OpenTUI 0.8.1. This removes the need to keep both Zig 0.16 and 0.17 installed to build OpenCode. Regenerate the C API bindings with script/ghostty-bindings and adapt to the new terminal creation API: ghostty_terminal_new() now takes `cols` and `rows` directly. The scrollback limit is set after construction with ghostty_terminal_set(GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_BYTES, ...), preserving the previous byte-budget semantics, and the terminal is freed through Drop if setting it fails. Update the process-daemon docs and CI workflows to Zig 0.17.0. The Windows ARM64 alignment workaround is no longer needed because the affected std code no longer exists in Zig 0.17.
0989ff6 to
4583e00
Compare
|
Thanks — pushed a fix:
The branch is rebased onto current |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
Both earlier points are fixed: the scrollback limit is set in bytes again (GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_BYTES), and it's set after Terminal is built, so Drop frees the terminal if the call fails. The README and the musl.rs comment now say Zig 0.17. I couldn't build or run it here (no Rust or Zig toolchain), so the Linux, macOS and Windows CI results still matter. Public API: unchanged. Nothing new that blocks a merge.
|
Heads-up: the persistent terminal is currently broken independently of this PR. 2.2.7 (and 2.2.6) ship a process-daemon that speaks protocol 8 while the client still speaks protocol 7:
It reproduces on macOS as well. The client-side protocol 8 update is #62976. This PR only changes the pinned Ghostty revision and its terminal API; the daemon still speaks protocol 8. |
Issue for this PR
Closes #63105
Type of change
What does this PR do?
Bumps the Ghostty revision pinned by
packages/process-daemonfromab0b9da9to v1.4.0 (83fb956).Ghostty 1.4.0 requires Zig 0.17.0, which is the version the TUI already needs for OpenTUI 0.8.1. The daemon currently requires Zig 0.16, so a full build needs both toolchains. This aligns them on 0.17.0.
The only API used by the daemon that changed is
ghostty_terminal_new(): it now takescolsandrowsdirectly instead of aGhosttyTerminalOptionsstruct. The scrollback limit is set after construction withghostty_terminal_set(GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_BYTES, ...), preserving the previous byte-budget behaviour (replay_capacityis measured in bytes). Doing it after construction also meansDropfrees the terminal if the call fails.ffi.rswas regenerated withscript/ghostty-bindings(bindgen 0.72.1).The process-daemon docs and CI workflows are moved to Zig 0.17.0. The Windows ARM64 function-pointer alignment workaround is removed because the affected std code no longer exists in 0.17.
How did you verify your code works?
Built and tested on FreeBSD 15.1 aarch64 with Zig 0.17.0 and Ghostty v1.4.0:
cargo build --release --lockedcargo clippy --locked --all-targets --all-features -- -D warningscargo test --release --locked: 81/82 pass. The remaining failure isdaemon::server::tests::missed_wake_is_detected, a timing-sensitive control-loop test. It fails identically on the unmodified daemon with the old Ghostty pin on this heavily loaded host, so it is not related to this change.I could not verify the Linux/macOS/Windows CI locally.
Checklist