diff options
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig index ff151323..9a8cd6da 100644 --- a/src/main.zig +++ b/src/main.zig @@ -18,6 +18,16 @@ pub const std_options_debug_io: std.Io = if (is_emscripten) else std_options_debug_threaded_io.?.io(); +// 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. +pub const panic = if (is_emscripten) std.debug.FullPanic(std.debug.defaultPanic) else std.debug.FullPanic(struct { + fn call(msg: []const u8, ret_addr: ?usize) noreturn { + @import("vaxis").recover(); + std.debug.defaultPanic(msg, ret_addr); + } +}.call); + const help_text = \\Usage: pardes [options] \\ |
