szn

Bug 498 — client silently exits 0 when setRaw fails

498. catch return swallows a fatal setup failure

Severity: LOW (UX/diagnostics) Status: 🟢 FIXED Files: src/main.zig (client entry, raw.setRaw() catch return)

Problem

If putting the terminal into raw mode fails (e.g. stdout isn’t a tty, tcsetattr denied), the client hits raw.setRaw() catch return and exits with status 0 having done nothing — no log line, no error, indistinguishable from success. A user scripting szn attach gets silent success with no session attached.

Proposed Fix

Log the failure and exit nonzero:

raw.setRaw() catch |err| {
    std.log.err("failed to set raw mode: {t}", .{err});
    std.process.exit(1);
};

Resolution