diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-23 17:52:15 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | fcfe51b6507ade9c72f94e40ee5c31a8ee818e30 (patch) | |
| tree | 2e0b3700c5d3e6882fdaf03725fa6c1de56206cb /src | |
| parent | ddc2eefb1e7cdd402593efb1297c25fc7ae4b110 (diff) | |
| download | pardes-fcfe51b6507ade9c72f94e40ee5c31a8ee818e30.tar.gz pardes-fcfe51b6507ade9c72f94e40ee5c31a8ee818e30.zip | |
macos fix
Diffstat (limited to 'src')
| -rw-r--r-- | src/gui.zig | 7 | ||||
| -rw-r--r-- | src/main.zig | 8 | ||||
| -rw-r--r-- | src/tty.zig | 4 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/gui.zig b/src/gui.zig index a53dfa24..b952da99 100644 --- a/src/gui.zig +++ b/src/gui.zig @@ -34,6 +34,7 @@ extern "c" fn forkpty(amaster: *c_int, name: ?[*:0]u8, termp: ?*const anyopaque, extern "c" fn execv(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8) c_int; extern "c" fn chdir(path: [*:0]const u8) c_int; extern "c" fn _exit(status: c_int) noreturn; +extern "c" fn setenv(name: [*:0]const u8, value: [*:0]const u8, overwrite: c_int) c_int; extern "c" fn emscripten_get_element_css_size(target: [*:0]const u8, width: *f64, height: *f64) c_int; const EMSCRIPTEN_RESULT_SUCCESS: c_int = 0; @@ -680,6 +681,9 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options) !void { // shells emit OSC 133 prompt marks via this rc (prompt hiding, click-move) writeFile(pardes.bash_rc); + // macos: apple's bash 3.2 prints the zsh-deprecation banner into every + // pane unless this is in the env BEFORE bash starts (the rc is too late) + if (comptime builtin.os.tag.isDarwin()) _ = setenv("BASH_SILENCE_DEPRECATION_WARNING", "1", 1); var ptys: [pardes.MAX_PANES]?Pty = @splat(null); // per-slot spawn generation: drops a dead shell's late output/eof when its @@ -976,6 +980,9 @@ fn runGrid(init: std.process.Init, opts_in: pardes.Options) !void { core.update(.{ .resize = .{ .cols = grid_cols, .rows = grid_rows } }); writeFile(pardes.bash_rc); + // macos: apple's bash 3.2 prints the zsh-deprecation banner into every + // pane unless this is in the env BEFORE bash starts (the rc is too late) + if (comptime builtin.os.tag.isDarwin()) _ = setenv("BASH_SILENCE_DEPRECATION_WARNING", "1", 1); var ptys: [pardes.MAX_PANES]?Pty = @splat(null); // per-slot spawn generation: drops a dead shell's late output/eof when its diff --git a/src/main.zig b/src/main.zig index 2e75de3d..47121691 100644 --- a/src/main.zig +++ b/src/main.zig @@ -18,6 +18,14 @@ pub const std_options_debug_io: std.Io = if (is_emscripten) else std_options_debug_threaded_io.?.io(); +// ghostty-vt's stream logs every mode it doesn't implement, and in the tty +// shell stderr IS the screen — the warning scribbles over the grid. macOS +// bash/readline sends one such mode (1034, meta-key) on every startup, so +// keep the stream scope to errors; linux shells just never tripped it. +pub const std_options: std.Options = .{ + .log_scope_levels = &.{.{ .scope = .stream, .level = .err }}, +}; + // A panic must restore the terminal (cooked mode, main screen, mouse off) // before the trace prints, or it lands garbled in a raw alt screen. recover() // no-ops unless the vaxis tty is live, so gui/tty share the handler. diff --git a/src/tty.zig b/src/tty.zig index 1342ef6f..3ff714bf 100644 --- a/src/tty.zig +++ b/src/tty.zig @@ -15,6 +15,7 @@ extern "c" fn forkpty(amaster: *c_int, name: ?[*:0]u8, termp: ?*const anyopaque, extern "c" fn execv(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8) c_int; extern "c" fn chdir(path: [*:0]const u8) c_int; extern "c" fn _exit(status: c_int) noreturn; +extern "c" fn setenv(name: [*:0]const u8, value: [*:0]const u8, overwrite: c_int) c_int; // absolute shell path per OS: execv must not search PATH (no allocation // between fork and exec) @@ -91,6 +92,9 @@ pub fn run(init: std.process.Init, opts: pardes.Options) !void { // shells emit OSC 133 prompt marks via this rc (prompt hiding, click-move) writeFile(pardes.bash_rc); + // macos: apple's bash 3.2 prints the zsh-deprecation banner into every + // pane unless this is in the env BEFORE bash starts (the rc is too late) + if (comptime builtin.os.tag.isDarwin()) _ = setenv("BASH_SILENCE_DEPRECATION_WARNING", "1", 1); var kitty_handles: [pardes.MAX_PANES]?vaxis.Image = @splat(null); var ptys: [pardes.MAX_PANES]?Pty = @splat(null); |
