diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 21:54:31 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | 30011f7269d0febdefbb4c907f8a28d932f44f6f (patch) | |
| tree | 722c5752673169d28f10fcd5227deac7419ca371 /src/tty | |
| parent | cc8b72c1b1fd19cd3ef159fe4f56c7b7916380ce (diff) | |
| download | pardes-30011f7269d0febdefbb4c907f8a28d932f44f6f.tar.gz pardes-30011f7269d0febdefbb4c907f8a28d932f44f6f.zip | |
An editor's private pardes-osc133 prompt files go at Exit and at a fatal signal, and a start sweeps the ones a dead editor left
/tmp had gathered thousands of private prompt files: Exit removed its
own, but an editor killed by a signal, or a crashed one, left them for
ever. They now carry their editor's pid in the name, a SIGTERM or
SIGHUP removes them before the signal's death, and each start removes
those whose pid kill(pid, 0) answers ESRCH for. Files of the older
shape carry no pid and are left alone, as a running older editor may
still read them; the shared ones in the runtime directory are kept,
being every session's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/tty')
| -rw-r--r-- | src/tty/tty.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig index 8d121b1f..a01df94b 100644 --- a/src/tty/tty.zig +++ b/src/tty/tty.zig @@ -1150,8 +1150,10 @@ const Killed = struct { _ = std.c.write(fd, reset, reset.len); _ = std.c.tcsetattr(fd, .FLUSH, &cooked); } - // The 9P socket goes too: a killed editor leaves none behind. + // The 9P socket and private prompt files go too: a killed editor + // leaves none behind. ninep_io.unlinkOwnSocket(); + host_io.Shell.unlinkOwnedRcs(); // SA_RESETHAND put the default back: the same signal, now fatal. _ = std.c.raise(sig); } |
