diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 19:02:34 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 19:02:34 -0300 |
| commit | 486f347adeed5bac6aaabe8be34e6a69bf323a62 (patch) | |
| tree | da8b333b4033889aa2fd16ab7f5a4bef35b0401d /dev | |
| parent | 4053e62a2aabd794db9075d93ebe57eec3f432a6 (diff) | |
| parent | 06f6c72583faf8256190a0ae195a8085e7cd7f32 (diff) | |
| download | pardes-486f347adeed5bac6aaabe8be34e6a69bf323a62.tar.gz pardes-486f347adeed5bac6aaabe8be34e6a69bf323a62.zip | |
integration: six small faults on a hang-up as a close: pardes-faults-6 (a hang-up with no daemon kills the language servers' children; the daemon's reader hands a note under a lock; a retried Edit write answered from the listener's hold; the cursor hidden when a frame has no caret; syntax-test deleted and the grammar tiers' tests skipping; the tty harness's Esc after what came before is read) and pardes-merge41, merged without a textual conflict; tui core-test 874/1031 (157 skipped), shell-test 1073/1076, term-test 17/17, both soaks diverged 0, unequal 0, unlisted 0, the window builds; the coordinator's gate in the ledger (reorg/merge42)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/lsp/lsp_client.zig | 5 | ||||
| -rw-r--r-- | dev/tui/tui.zig | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/dev/lsp/lsp_client.zig b/dev/lsp/lsp_client.zig index 4ad8dace..fdd4af55 100644 --- a/dev/lsp/lsp_client.zig +++ b/dev/lsp/lsp_client.zig @@ -2244,8 +2244,9 @@ fn reap(pid: libc.pid_t) void { /// At this process's exit, every server's group is killed: a server busy /// in a build (zls at a cold start) would not notice its socket close, and /// lived on with its children after the editor. Registered once, at the -/// first spawn; signals only, no locks (other threads may hold them). -fn killAllAtExit() callconv(.c) void { +/// first spawn; signals only, no locks (other threads may hold them): a +/// signal's handler calls it too (tui.zig `Killed`). +pub fn killAllAtExit() callconv(.c) void { for (&conns) |*c| if (c.pid > 0) { _ = libc.kill(-c.pid, .KILL); }; diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig index 67c0e2a0..e441df92 100644 --- a/dev/tui/tui.zig +++ b/dev/tui/tui.zig @@ -909,7 +909,7 @@ const Screen = struct { /// the main screen, no mouse, paste or keyboard modes, the cursor shown, /// cooked termios -- and then the signal's own death. A nested editor /// killed in a pane must not leave that pane's terminal wedged. -/// Async-signal-safe: write, tcsetattr, sigaction, raise. +/// Async-signal-safe: write, tcsetattr, kill, sigaction, raise. const Killed = struct { var fd: posix.fd_t = -1; var cooked: posix.termios = undefined; @@ -940,6 +940,8 @@ const Killed = struct { ninep_io.unlinkOwnSocket(); host_io.Shell.unlinkOwnedRcs(); daemon.hangUp(); + // No exit hook runs: the language servers' groups go here. + @import("../lsp/lsp_client.zig").killAllAtExit(); // SA_RESETHAND put the default back: the same signal, now fatal. _ = std.c.raise(sig); } @@ -1789,10 +1791,12 @@ const Shell = struct { vx.freeImage(sc.tty.writer(), removed.value.id); if (stale_len < stale.len) break; } + // A frame with no caret hides the terminal's cursor: shown, it + // would stay where the last caret was. if (shown.cursor) |cur| { win.showCursor(cur.x, cur.y); win.setCursorShape(if (cur.bar) .beam else .default); - } + } else win.hideCursor(); const tz_render = tracy.zone(@src(), "vx.render"); const before = sc.tty.tty_writer.pos + sc.tty.writer().end; vx.render(sc.tty.writer()) catch {}; |
