summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.zig17
-rw-r--r--docs/ideas.typ4
-rw-r--r--src/gui.zig7
-rw-r--r--src/main.zig8
-rw-r--r--src/tty.zig4
5 files changed, 36 insertions, 4 deletions
diff --git a/build.zig b/build.zig
index 58179faf..2b728ea1 100644
--- a/build.zig
+++ b/build.zig
@@ -304,11 +304,20 @@ pub fn build(b: *std.Build) void {
// (.{ .READ = true, .WRITE = true });
// src/terminal/kitty/graphics_image.zig:185 — shm_open's variadic mode
// literal 0 must be @as(std.c.mode_t, 0).
+ // Darwin HOSTS need a third: src/build/GhosttyDist.zig:28 — the dist
+ // tarball's GTK resources run pkg-config for libadwaita eagerly (panics
+ // without it); gate that block on `b.graph.host.result.os.tag == .linux`.
+ // Ghostty's pinned translate-c tarball also 404s now (codeberg dropped
+ // the archive endpoint) — seed zig-pkg/ from a machine that has it.
const ghostty_simd = !target.result.os.tag.isDarwin() or b.graph.host.result.os.tag.isDarwin();
+ // app-runtime none + emit-xcframework off: only the ghostty-vt module is
+ // consumed, and the defaults otherwise drag ghostty's app graph into the
+ // build — gtk4 header translation via host pkg-config for linux targets,
+ // the Xcode app graph (iOS SDK, xcodebuild) on darwin hosts.
const ghostty_dep = if (is_emscripten)
b.lazyDependency("ghostty", .{ .simd = false })
else
- b.lazyDependency("ghostty", .{ .target = target, .optimize = optimize, .simd = ghostty_simd });
+ b.lazyDependency("ghostty", .{ .target = target, .optimize = optimize, .simd = ghostty_simd, .@"app-runtime" = .none, .@"emit-xcframework" = false });
if (ghostty_dep) |dep| {
const ghostty_vt = dep.module("ghostty-vt");
ghostty_vt_for_snap = ghostty_vt;
@@ -365,6 +374,12 @@ pub fn build(b: *std.Build) void {
if (emscripten_include) |include| root_mod.addSystemIncludePath(include);
if (is_emscripten) wasm_libs.append(b.allocator, sdl_lib.getEmittedBin()) catch @panic("OOM");
}
+ // darwin: SDL_GPU only speaks SPIRV here (shaders/*.glsl -> glslc), so
+ // it must pick its vulkan backend via the Vulkan SDK's loader +
+ // MoltenVK in /usr/local/lib — a path dyld no longer searches for
+ // bare dlopen names. The rpath restores that lookup.
+ if (target.result.os.tag.isDarwin())
+ root_mod.addRPath(.{ .cwd_relative = "/usr/local/lib" });
root_mod.addIncludePath(b.path("vendor/stb"));
root_mod.addCSourceFile(.{ .file = b.path("vendor/stb/stb_truetype_impl.c") });
root_mod.addCSourceFile(.{ .file = b.path("vendor/stb/font.c") });
diff --git a/docs/ideas.typ b/docs/ideas.typ
index f4faf810..c954dbbd 100644
--- a/docs/ideas.typ
+++ b/docs/ideas.typ
@@ -8,6 +8,4 @@
- like if I get some search results I can just use tab to navigate them, the editor should know:
- semantic boundaries (maybe just jump to the next clickable thing?)
-- undo for everything?
- - I want search results in general to be logged, that's one of the reasons why the tty is a good fit
- - so it'd be cool to undo that too?
+|- web: native web client (DOM-rendered, not canvas/WASM). Use WASM only for text logic (parsing, grep, treesitter analysis, look internals) — rendering stays in native DOM/CSS for accessibility, performance, and browser-native text selection. Send structured display commands (layout tree, styled spans, cursor, scroll pos) from WASM to JS via a flat buffer or JSON.
diff --git a/src/gui.zig b/src/gui.zig
index f170e1a6..1947cd75 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;
@@ -864,6 +865,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
@@ -1280,6 +1284,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);