Skip to content

Commit 4583e00

Browse files
committed
chore(process-daemon): update Ghostty to 1.4.0
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.
1 parent d4aeee5 commit 4583e00

7 files changed

Lines changed: 73 additions & 75 deletions

File tree

‎.github/workflows/check-process-daemon.yml‎

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ jobs:
5858
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5959
- uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5
6060
with:
61-
version: 0.16.0
61+
version: 0.17.0
6262
- name: Install Rust
6363
run: rustup toolchain install 1.90.0 --profile minimal --component rustfmt --component clippy
6464
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
6565
with:
66-
key: core-${{ matrix.os }}-zig-0.16.0
66+
key: core-${{ matrix.os }}-zig-0.17.0
6767
workspaces: packages/process-daemon -> target
6868
cache-workspace-crates: true
6969
- run: cargo fmt --check
@@ -108,28 +108,18 @@ jobs:
108108
- uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5
109109
if: matrix.arch == 'x64'
110110
with:
111-
version: 0.16.0
111+
version: 0.17.0
112112
cache-key: ${{ matrix.target }}
113-
# Zig 0.16 crashes when building Ghostty on the native ARM64 host.
113+
# Zig 0.16 crashed when building Ghostty on the native ARM64 host.
114114
# Use x64-hosted compilers on this ARM64 runner, but execute ARM64 tests natively.
115115
- name: Install x64 Zig for ARM64 cross-compilation
116116
if: matrix.arch == 'arm64'
117117
run: |
118118
$archive = Join-Path $env:RUNNER_TEMP 'zig-x64.zip'
119-
Invoke-WebRequest 'https://ziglang.org/download/0.16.0/zig-x86_64-windows-0.16.0.zip' -OutFile $archive
120-
if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne '68659eb5f1e4eb1437a722f1dd889c5a322c9954607f5edcf337bc3684a75a7e') { throw 'Zig archive checksum mismatch' }
119+
Invoke-WebRequest 'https://ziglang.org/download/0.17.0/zig-x86_64-windows-0.17.0.zip' -OutFile $archive
120+
if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne 'b5663f69581dcf391293fbf16c06cb80d81d806545ce618b4d0bab7f0eb8c428') { throw 'Zig archive checksum mismatch' }
121121
Expand-Archive $archive -DestinationPath $env:RUNNER_TEMP
122-
Join-Path $env:RUNNER_TEMP 'zig-x86_64-windows-0.16.0' >> $env:GITHUB_PATH
123-
- name: Fix Zig 0.16 ARM64 function-pointer alignment
124-
if: matrix.arch == 'arm64'
125-
run: |
126-
# ARM64 function pointers require 4-byte alignment, unlike *anyopaque.
127-
# Zig 0.16's Windows stack-trace helper omits the required alignment assertion.
128-
$file = Join-Path $env:RUNNER_TEMP 'zig-x86_64-windows-0.16.0/lib/std/debug/SelfInfo/Windows.zig'
129-
$source = [System.IO.File]::ReadAllText($file)
130-
$old = '@ptrCast(try si.loadNtdllProc(@tagName(proc)))'
131-
if (!$source.Contains($old)) { throw 'Zig alignment workaround no longer matches; re-evaluate it' }
132-
[System.IO.File]::WriteAllText($file, $source.Replace($old, '@ptrCast(@alignCast(try si.loadNtdllProc(@tagName(proc))))'))
122+
Join-Path $env:RUNNER_TEMP 'zig-x86_64-windows-0.17.0' >> $env:GITHUB_PATH
133123
- name: Install Rust toolchain and target
134124
run: rustup toolchain install $env:RUSTUP_TOOLCHAIN --force-non-host --profile minimal --component rustfmt --component clippy --target $env:CARGO_BUILD_TARGET
135125
- name: Verify runner and compiler architecture
@@ -148,7 +138,7 @@ jobs:
148138
# No cache-on-failure: a timed-out run once saved a partial cache that broke re-runs.
149139
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2
150140
with:
151-
key: windows-${{ matrix.target }}-zig-0.16.0
141+
key: windows-${{ matrix.target }}-zig-0.17.0
152142
workspaces: packages/process-daemon -> target
153143
# The native Ghostty build is now an output of the workspace crate.
154144
cache-workspace-crates: true

‎.github/workflows/release-process-daemon.yml‎

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ defaults:
2525

2626
env:
2727
CARGO_TERM_COLOR: always
28-
ZIG_VERSION: 0.16.0
28+
ZIG_VERSION: 0.17.0
2929
GNU_GLIBC_VERSION: "2.30"
3030
CARGO_ZIGBUILD_VERSION: 0.23.2
3131

@@ -188,24 +188,16 @@ jobs:
188188
with:
189189
version: ${{ env.ZIG_VERSION }}
190190
cache-key: release-${{ matrix.target }}
191-
# Zig 0.16 crashes when building Ghostty on the native ARM64 host, so use
191+
# Zig 0.16 crashed when building Ghostty on the native ARM64 host, so use
192192
# the x64-hosted compiler there (matching check-process-daemon.yml).
193193
- name: Install x64 Zig for ARM64 cross-compilation
194194
if: matrix.arch == 'arm64'
195195
run: |
196196
$archive = Join-Path $env:RUNNER_TEMP 'zig-x64.zip'
197-
Invoke-WebRequest 'https://ziglang.org/download/0.16.0/zig-x86_64-windows-0.16.0.zip' -OutFile $archive
198-
if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne '68659eb5f1e4eb1437a722f1dd889c5a322c9954607f5edcf337bc3684a75a7e') { throw 'Zig archive checksum mismatch' }
197+
Invoke-WebRequest 'https://ziglang.org/download/0.17.0/zig-x86_64-windows-0.17.0.zip' -OutFile $archive
198+
if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne 'b5663f69581dcf391293fbf16c06cb80d81d806545ce618b4d0bab7f0eb8c428') { throw 'Zig archive checksum mismatch' }
199199
Expand-Archive $archive -DestinationPath $env:RUNNER_TEMP
200-
Join-Path $env:RUNNER_TEMP 'zig-x86_64-windows-0.16.0' >> $env:GITHUB_PATH
201-
- name: Fix Zig 0.16 ARM64 function-pointer alignment
202-
if: matrix.arch == 'arm64'
203-
run: |
204-
$file = Join-Path $env:RUNNER_TEMP 'zig-x86_64-windows-0.16.0/lib/std/debug/SelfInfo/Windows.zig'
205-
$source = [System.IO.File]::ReadAllText($file)
206-
$old = '@ptrCast(try si.loadNtdllProc(@tagName(proc)))'
207-
if (!$source.Contains($old)) { throw 'Zig alignment workaround no longer matches; re-evaluate it' }
208-
[System.IO.File]::WriteAllText($file, $source.Replace($old, '@ptrCast(@alignCast(try si.loadNtdllProc(@tagName(proc))))'))
200+
Join-Path $env:RUNNER_TEMP 'zig-x86_64-windows-0.17.0' >> $env:GITHUB_PATH
209201
- name: Install Rust toolchain and target
210202
run: rustup toolchain install $env:RUSTUP_TOOLCHAIN --force-non-host --profile minimal --target $env:CARGO_BUILD_TARGET
211203
- name: Build

‎packages/process-daemon/README.md‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ to the complete response including metadata.
225225

226226
## Verification
227227

228-
Install Git, Rust 1.90.0, and Zig 0.16.0. Normal builds do not need bindgen or
228+
Install Git, Rust 1.90.0, and Zig 0.17.0. Normal builds do not need bindgen or
229229
libclang and do not depend on a third-party Ghostty Rust crate.
230230

231231
```sh
@@ -238,7 +238,7 @@ printf 'demo\nlist\nquit\n' | cargo run -- play --name play
238238
### Direct Ghostty bindings
239239

240240
`ghostty-revision` pins the official [ghostty-org/ghostty](https://github.com/ghostty-org/ghostty)
241-
source. `build.rs` fetches that commit, builds libghostty with Zig 0.16, and
241+
source. `build.rs` fetches that commit, builds libghostty with Zig 0.17, and
242242
links its static archive (`ghostty-vt-static.lib` on Windows, not the DLL
243243
import library). It uses an isolated checkout under Cargo's build directory.
244244
The package declares `links = "ghostty-vt"` so Cargo rejects dependency graphs
@@ -292,10 +292,8 @@ MIRIFLAGS=-Zmiri-tree-borrows cargo +nightly-2026-09-02 miri test --locked --man
292292
The Windows jobs in the monorepo's
293293
`.github/workflows/check-process-daemon.yml` build for Windows x64 and ARM64 and execute
294294
tests natively on `windows-2025` and `windows-11-arm`, respectively. The ARM64
295-
job uses x64-hosted compilers targeting ARM64 because native ARM64 Zig 0.16
296-
crashes while building Ghostty; the tests themselves remain native ARM64.
297-
The job also applies a guarded one-line alignment fix to Zig 0.16's Windows
298-
stack-trace helper, which otherwise fails to compile for ARM64.
295+
job uses x64-hosted compilers targeting ARM64; the tests themselves remain
296+
native ARM64.
299297
The workflow runs on pull requests and pushes to `dev` that touch
300298
`packages/process-daemon`, independently of the release workflow.
301299
It checks formatting, builds the executable, runs all enabled tests, and checks
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ab0b9da9e88fcb4b0533a1854e84628f663930af
1+
83fb95624b0439ee660c2679b43b38c8b63769cd

‎packages/process-daemon/src/ghostty/ffi.rs‎

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* automatically generated by rust-bindgen 0.72.1 */
22

3-
// Ghostty revision: ab0b9da9e88fcb4b0533a1854e84628f663930af
3+
// Ghostty revision: 83fb95624b0439ee660c2679b43b38c8b63769cd
44
// Generated from the official C API; regenerate with script/ghostty-bindings.
55
#![allow(
66
dead_code,
@@ -15,6 +15,9 @@ pub const GHOSTTY_OUT_OF_MEMORY: GhosttyResult = -1;
1515
pub const GHOSTTY_INVALID_VALUE: GhosttyResult = -2;
1616
pub const GHOSTTY_OUT_OF_SPACE: GhosttyResult = -3;
1717
pub const GHOSTTY_NO_VALUE: GhosttyResult = -4;
18+
pub const GHOSTTY_IO_ERROR: GhosttyResult = -5;
19+
pub const GHOSTTY_LIMIT_EXCEEDED: GhosttyResult = -6;
20+
pub const GHOSTTY_REJECTED: GhosttyResult = -7;
1821
pub const GHOSTTY_RESULT_MAX_VALUE: GhosttyResult = 2147483647;
1922
pub type GhosttyResult = ::std::os::raw::c_int;
2023
#[repr(C)]
@@ -33,7 +36,7 @@ pub const GHOSTTY_FORMATTER_FORMAT_PLAIN: GhosttyFormatterFormat = 0;
3336
pub const GHOSTTY_FORMATTER_FORMAT_VT: GhosttyFormatterFormat = 1;
3437
pub const GHOSTTY_FORMATTER_FORMAT_HTML: GhosttyFormatterFormat = 2;
3538
pub const GHOSTTY_FORMATTER_FORMAT_MAX_VALUE: GhosttyFormatterFormat = 2147483647;
36-
pub type GhosttyFormatterFormat = ::std::os::raw::c_uint;
39+
pub type GhosttyFormatterFormat = ::std::os::raw::c_int;
3740
#[repr(C)]
3841
#[derive(Debug, Copy, Clone)]
3942
pub struct GhosttyString {
@@ -187,7 +190,7 @@ pub const GHOSTTY_POINT_TAG_VIEWPORT: GhosttyPointTag = 1;
187190
pub const GHOSTTY_POINT_TAG_SCREEN: GhosttyPointTag = 2;
188191
pub const GHOSTTY_POINT_TAG_HISTORY: GhosttyPointTag = 3;
189192
pub const GHOSTTY_POINT_TAG_MAX_VALUE: GhosttyPointTag = 2147483647;
190-
pub type GhosttyPointTag = ::std::os::raw::c_uint;
193+
pub type GhosttyPointTag = ::std::os::raw::c_int;
191194
#[repr(C)]
192195
#[derive(Copy, Clone)]
193196
pub union GhosttyPointValue {
@@ -308,36 +311,19 @@ unsafe extern "C" {
308311
out_written: *mut usize,
309312
) -> GhosttyResult;
310313
}
311-
#[repr(C)]
312-
#[derive(Debug, Default, Copy, Clone)]
313-
pub struct GhosttyTerminalOptions {
314-
pub cols: u16,
315-
pub rows: u16,
316-
pub max_scrollback: usize,
317-
}
318-
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
319-
const _: () = {
320-
["Size of GhosttyTerminalOptions"][::std::mem::size_of::<GhosttyTerminalOptions>() - 16usize];
321-
["Alignment of GhosttyTerminalOptions"]
322-
[::std::mem::align_of::<GhosttyTerminalOptions>() - 8usize];
323-
["Offset of field: GhosttyTerminalOptions::cols"]
324-
[::std::mem::offset_of!(GhosttyTerminalOptions, cols) - 0usize];
325-
["Offset of field: GhosttyTerminalOptions::rows"]
326-
[::std::mem::offset_of!(GhosttyTerminalOptions, rows) - 2usize];
327-
["Offset of field: GhosttyTerminalOptions::max_scrollback"]
328-
[::std::mem::offset_of!(GhosttyTerminalOptions, max_scrollback) - 8usize];
329-
};
330314
pub const GHOSTTY_SCROLL_VIEWPORT_TOP: GhosttyTerminalScrollViewportTag = 0;
331315
pub const GHOSTTY_SCROLL_VIEWPORT_BOTTOM: GhosttyTerminalScrollViewportTag = 1;
332316
pub const GHOSTTY_SCROLL_VIEWPORT_DELTA: GhosttyTerminalScrollViewportTag = 2;
333317
pub const GHOSTTY_SCROLL_VIEWPORT_ROW: GhosttyTerminalScrollViewportTag = 3;
318+
pub const GHOSTTY_SCROLL_VIEWPORT_DELTA_PROMPT: GhosttyTerminalScrollViewportTag = 4;
334319
pub const GHOSTTY_SCROLL_VIEWPORT_MAX_VALUE: GhosttyTerminalScrollViewportTag = 2147483647;
335-
pub type GhosttyTerminalScrollViewportTag = ::std::os::raw::c_uint;
320+
pub type GhosttyTerminalScrollViewportTag = ::std::os::raw::c_int;
336321
#[repr(C)]
337322
#[derive(Copy, Clone)]
338323
pub union GhosttyTerminalScrollViewportValue {
339324
pub delta: isize,
340325
pub row: usize,
326+
pub delta_prompt: isize,
341327
pub _padding: [u64; 2usize],
342328
}
343329
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
@@ -350,6 +336,8 @@ const _: () = {
350336
[::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, delta) - 0usize];
351337
["Offset of field: GhosttyTerminalScrollViewportValue::row"]
352338
[::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, row) - 0usize];
339+
["Offset of field: GhosttyTerminalScrollViewportValue::delta_prompt"]
340+
[::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, delta_prompt) - 0usize];
353341
["Offset of field: GhosttyTerminalScrollViewportValue::_padding"]
354342
[::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, _padding) - 0usize];
355343
};
@@ -426,8 +414,29 @@ pub const GHOSTTY_TERMINAL_OPT_DEFAULT_CURSOR_BLINK: GhosttyTerminalOption = 23;
426414
pub const GHOSTTY_TERMINAL_OPT_GLYPH_PROTOCOL: GhosttyTerminalOption = 24;
427415
pub const GHOSTTY_TERMINAL_OPT_PWD_CHANGED: GhosttyTerminalOption = 25;
428416
pub const GHOSTTY_TERMINAL_OPT_CLIPBOARD_WRITE: GhosttyTerminalOption = 26;
417+
pub const GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_BYTES: GhosttyTerminalOption = 27;
418+
pub const GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_LINES: GhosttyTerminalOption = 28;
419+
pub const GHOSTTY_TERMINAL_OPT_DESKTOP_NOTIFICATION: GhosttyTerminalOption = 29;
420+
pub const GHOSTTY_TERMINAL_OPT_PROGRESS_REPORT: GhosttyTerminalOption = 30;
421+
pub const GHOSTTY_TERMINAL_OPT_CONTINUATION_MAX_BYTES: GhosttyTerminalOption = 31;
422+
pub const GHOSTTY_TERMINAL_OPT_TITLE_REPORT: GhosttyTerminalOption = 32;
423+
pub const GHOSTTY_TERMINAL_OPT_MODE_DEFAULT: GhosttyTerminalOption = 33;
424+
pub const GHOSTTY_TERMINAL_OPT_MODE: GhosttyTerminalOption = 34;
425+
pub const GHOSTTY_TERMINAL_OPT_UNKNOWN_SEQUENCE: GhosttyTerminalOption = 35;
426+
pub const GHOSTTY_TERMINAL_OPT_UNKNOWN_MAX_BYTES: GhosttyTerminalOption = 36;
427+
pub const GHOSTTY_TERMINAL_OPT_TERMINFO_NAME: GhosttyTerminalOption = 37;
428+
pub const GHOSTTY_TERMINAL_OPT_CLIPBOARD_READ: GhosttyTerminalOption = 38;
429+
pub const GHOSTTY_TERMINAL_OPT_CLIPBOARD_WRITE_MAX_BYTES: GhosttyTerminalOption = 39;
430+
pub const GHOSTTY_TERMINAL_OPT_RESIZE_PULL_SCROLLBACK: GhosttyTerminalOption = 40;
431+
pub const GHOSTTY_TERMINAL_OPT_RENDER_HOLD: GhosttyTerminalOption = 41;
432+
pub const GHOSTTY_TERMINAL_OPT_SEMANTIC_PROMPT: GhosttyTerminalOption = 42;
433+
pub const GHOSTTY_TERMINAL_OPT_RESET: GhosttyTerminalOption = 43;
434+
pub const GHOSTTY_TERMINAL_OPT_XT_CHECKSUM_REPORT: GhosttyTerminalOption = 44;
435+
pub const GHOSTTY_TERMINAL_OPT_XT_CHECKSUM_EXTENSION: GhosttyTerminalOption = 45;
436+
pub const GHOSTTY_TERMINAL_OPT_PROGRAM_STATUS: GhosttyTerminalOption = 46;
437+
pub const GHOSTTY_TERMINAL_OPT_RESIZE_WINDOW: GhosttyTerminalOption = 47;
429438
pub const GHOSTTY_TERMINAL_OPT_MAX_VALUE: GhosttyTerminalOption = 2147483647;
430-
pub type GhosttyTerminalOption = ::std::os::raw::c_uint;
439+
pub type GhosttyTerminalOption = ::std::os::raw::c_int;
431440
pub const GHOSTTY_TERMINAL_DATA_INVALID: GhosttyTerminalData = 0;
432441
pub const GHOSTTY_TERMINAL_DATA_COLS: GhosttyTerminalData = 1;
433442
pub const GHOSTTY_TERMINAL_DATA_ROWS: GhosttyTerminalData = 2;
@@ -462,13 +471,23 @@ pub const GHOSTTY_TERMINAL_DATA_KITTY_GRAPHICS: GhosttyTerminalData = 30;
462471
pub const GHOSTTY_TERMINAL_DATA_SELECTION: GhosttyTerminalData = 31;
463472
pub const GHOSTTY_TERMINAL_DATA_VIEWPORT_ACTIVE: GhosttyTerminalData = 32;
464473
pub const GHOSTTY_TERMINAL_DATA_VT_PROCESSING_ERROR: GhosttyTerminalData = 33;
474+
pub const GHOSTTY_TERMINAL_DATA_SCROLLBACK_MAX_BYTES: GhosttyTerminalData = 34;
475+
pub const GHOSTTY_TERMINAL_DATA_SCROLLBACK_MAX_LINES: GhosttyTerminalData = 35;
476+
pub const GHOSTTY_TERMINAL_DATA_CONTINUATION_MAX_BYTES: GhosttyTerminalData = 36;
477+
pub const GHOSTTY_TERMINAL_DATA_MODE: GhosttyTerminalData = 37;
478+
pub const GHOSTTY_TERMINAL_DATA_VT_GROUND: GhosttyTerminalData = 38;
479+
pub const GHOSTTY_TERMINAL_DATA_CURSOR_AT_PROMPT: GhosttyTerminalData = 39;
480+
pub const GHOSTTY_TERMINAL_DATA_CLIPBOARD_WRITE_MAX_BYTES: GhosttyTerminalData = 40;
481+
pub const GHOSTTY_TERMINAL_DATA_MOUSE_SHAPE: GhosttyTerminalData = 41;
482+
pub const GHOSTTY_TERMINAL_DATA_MEMORY_USAGE: GhosttyTerminalData = 42;
465483
pub const GHOSTTY_TERMINAL_DATA_MAX_VALUE: GhosttyTerminalData = 2147483647;
466-
pub type GhosttyTerminalData = ::std::os::raw::c_uint;
484+
pub type GhosttyTerminalData = ::std::os::raw::c_int;
467485
unsafe extern "C" {
468486
pub fn ghostty_terminal_new(
469487
allocator: *const GhosttyAllocator,
470488
terminal: *mut GhosttyTerminal,
471-
options: GhosttyTerminalOptions,
489+
cols: u16,
490+
rows: u16,
472491
) -> GhosttyResult;
473492
}
474493
unsafe extern "C" {

‎packages/process-daemon/src/ghostty/mod.rs‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,24 @@ impl Terminal {
4545
let mut raw = ptr::null_mut();
4646
// SAFETY: options match the pinned C header; NULL selects Ghostty's allocator.
4747
check(unsafe {
48-
ffi::ghostty_terminal_new(
49-
ptr::null(),
50-
&mut raw,
51-
ffi::GhosttyTerminalOptions {
52-
cols: options.cols,
53-
rows: options.rows,
54-
max_scrollback: options.max_scrollback,
55-
},
56-
)
48+
ffi::ghostty_terminal_new(ptr::null(), &mut raw, options.cols, options.rows)
5749
})?;
5850
let terminal = Self {
5951
raw: NonNull::new(raw).context("Ghostty returned a null terminal")?,
6052
effects: Effects::default(),
6153
_actor: PhantomData,
6254
};
6355

64-
// SAFETY: userdata is an Rc-derived shared pointer retained until after terminal_free.
56+
// SAFETY: the scrollback value is a usize for the duration of the call, and
57+
// userdata is an Rc-derived shared pointer retained until after terminal_free.
6558
// These callbacks only copy responses/mark a title change; they never reenter Ghostty.
6659
unsafe {
60+
let max_scrollback = options.max_scrollback;
61+
check(ffi::ghostty_terminal_set(
62+
raw,
63+
ffi::GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_BYTES,
64+
&max_scrollback as *const usize as *const _,
65+
))?;
6766
check(ffi::ghostty_terminal_set(
6867
raw,
6968
ffi::GHOSTTY_TERMINAL_OPT_USERDATA,

‎packages/process-daemon/src/musl.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::ffi::{c_char, c_int, c_uint, c_void};
22

3-
/// Zig 0.16 assumes musl provides `statx` (added in musl 1.2.5), so libghostty
3+
/// Zig 0.17 assumes musl provides `statx` (added in musl 1.2.5), so libghostty
44
/// references it, but Rust's self-contained musl is older. Forward to the raw
55
/// syscall exactly as musl's own wrapper does.
66
///

0 commit comments

Comments
 (0)