From 30011f7269d0febdefbb4c907f8a28d932f44f6f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 21:54:31 -0300 Subject: 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 --- src/tty/tty.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/tty') 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); } -- cgit v1.3