From 2b76b47c8a087b81be139b552d9a41bb2006dcd3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 28 Jul 2026 12:28:27 -0300 Subject: fixing some crashes --- build.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index c62ee222..a4d530f1 100644 --- a/build.zig +++ b/build.zig @@ -314,10 +314,20 @@ pub fn build(b: *std.Build) void { // 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. + // NEVER hand ghostty `.Debug`: that flips its `slow_runtime_safety`, which + // walks the whole PageList after every mutation and PANICS the app on a + // transient state its own next lines repair — `PageList.resizeCols` grows + // rows BEFORE it moves a history viewport pin back into the active area, + // so widening a window whose scrollback holds wrapped lines dies with + // "PageList integrity check failed: ViewportPinInsufficientRows". Those + // checks are a ghostty-development tool (upstream ships them off); Zig's + // own safety checks come from OUR optimize mode and are unaffected, since + // ghostty-vt is a module compiled into this binary. See reflow.snap. + const ghostty_optimize: std.builtin.OptimizeMode = if (optimize == .Debug) .ReleaseSafe else optimize; const ghostty_dep = if (is_emscripten) b.lazyDependency("ghostty", .{ .simd = false }) else - b.lazyDependency("ghostty", .{ .target = target, .optimize = optimize, .simd = ghostty_simd, .@"app-runtime" = .none, .@"emit-xcframework" = false }); + b.lazyDependency("ghostty", .{ .target = target, .optimize = ghostty_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; -- cgit v1.3