summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-07 23:06:14 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commitacb5be9e71f0faf3781c7d57cdb0ba829ab3e5c4 (patch)
tree339c871ad72b967e4e97789d6f4f4559ed12da02 /test
parentc4cb26fe6f061dd4bcfb9e9df7b7d4e4d434d10a (diff)
downloadpardes-acb5be9e71f0faf3781c7d57cdb0ba829ab3e5c4.tar.gz
pardes-acb5be9e71f0faf3781c7d57cdb0ba829ab3e5c4.zip
fix tty crash on outer-terminal resize (font-size change): SIGWINCH is blocked in every thread and consumed on a dedicated sigwait thread instead of vaxis's signal handler, which locked std.Io mutexes from signal context and panicked the Io.Threaded machinery; pane shells unblock it after fork so bash/vim still see resizes. winch.snap storms WINCH from a pane (crashed pre-fix) and checks a real resize still reflows.
Diffstat (limited to 'test')
-rw-r--r--test/snapshots/winch.golden66
-rw-r--r--test/snapshots/winch.snap19
2 files changed, 85 insertions, 0 deletions
diff --git a/test/snapshots/winch.golden b/test/snapshots/winch.golden
new file mode 100644
index 00000000..f0b1277b
--- /dev/null
+++ b/test/snapshots/winch.golden
@@ -0,0 +1,66 @@
+== snap storm grid=100x30 cursor=4,6
+|Kill Newcol Tutor Debug Colors NextColor Dump
+| TTY /tmp/pardes-snap/winch/cwd Del NOR /tmp/pardes-snap/winch/cwd Del
+| $ ls
+| $ for i in $(seq 600); do kill -WINCH $PPID; don
+| e; echo SUR''VIVED
+| SURVIVED
+| $
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/winch/cwd Del
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== snap resized grid=106x34 cursor=4,6
+|Kill Newcol Tutor Debug Colors NextColor Dump
+| TTY /tmp/pardes-snap/winch/cwd Del NOR /tmp/pardes-snap/winch/cwd Del
+| $ ls
+| $ for i in $(seq 600); do kill -WINCH $PPID; done;
+| echo SUR''VIVED
+| SURVIVED
+| $
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+| NOR /tmp/pardes-snap/winch/cwd Del
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
diff --git a/test/snapshots/winch.snap b/test/snapshots/winch.snap
new file mode 100644
index 00000000..b1376ab3
--- /dev/null
+++ b/test/snapshots/winch.snap
@@ -0,0 +1,19 @@
+# SIGWINCH crash (reported as "crash on font-size change"): resizing the outer
+# terminal delivers SIGWINCH, and vaxis's default handler locks std.Io mutexes
+# from signal context — landing on a thread inside an Io.Threaded syscall
+# region (pty readers in read(2), main parked in queue.pop) panicked the Io
+# machinery and killed pardes. Now every thread blocks SIGWINCH and a sigwait
+# watcher consumes it. The in-pane kill storm below crashed pardes before the
+# fix; the resize after proves the watcher still reflows the grid.
+start 30 100 -n 3
+stable 700 20000
+key c-b
+stable 600 8000
+text for i in $(seq 600); do kill -WINCH $PPID; done; echo SUR''VIVED
+key enter
+wait 15000 SURVIVED
+stable 700 15000
+snap storm
+resize 34 106
+stable 700 15000
+snap resized