summaryrefslogtreecommitdiff
path: root/test/snapshot.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-06 12:45:47 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commitbca5d6a52500e72ec4de69c38f6fb2324df4b503 (patch)
treebc59bd97a668b4780cb8e591f66162ead4b2ac3d /test/snapshot.zig
parentde4def3548a6729b0dfd2120495a61beef8c8c2c (diff)
downloadpardes-bca5d6a52500e72ec4de69c38f6fb2324df4b503.tar.gz
pardes-bca5d6a52500e72ec4de69c38f6fb2324df4b503.zip
tty shell: leave the terminal clean on every exit path. Root causes: vaxis.Tty.init makes the tty raw but run() never called tty.deinit (termios stayed raw -> no echo, staircased output in the spawner shell); the pty reader tasks were never joined (Kill-quit hung the exit in the runtime thread-join with readers blocked in read(2), and finished readers dumped DebugAllocator leak traces onto the tty). Fix: defer tty.deinit() (runs last, after vx.deinit flushes its resets); cancel each pty reader at teardown (cancel interrupts the blocked read) then close masters and drain the loop queue (queued pty_read/paste bytes are gpa-owned); await the reader on pty_eof before closing; readPty posts its eof via tryPostEvent so a post-cancel full queue can't re-block; root panic handler wraps vaxis.recover() so a panic restores cooked mode/main screen/mouse before the trace prints (vaxis.Panic itself is stale: references std.debug.FormattedPanic which 0.16 dropped). Verified with a scripted pty harness (bash spawner, DSR replies): both quit paths (exit-EOF of last pane, middle-click Kill) end with rmcup+cursor+sgr+mouse-off and identical stty -a before/after, no leak spew, prompt back in 0.5s; snap suite 18/18.
Diffstat (limited to 'test/snapshot.zig')
0 files changed, 0 insertions, 0 deletions