From 3b0b9844d01f607ac07630682e3b92d3f9a84bff Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 16:39:16 -0300 Subject: terminal: a pane without an emulator (a file's, a picker's, a preview's) torn down in a replica's speculation does not stop it: deinitEmulator asked the authority before it looked for an emulator, so the input after any close (its reap) waited a round trip (the finder's typing, 4 of 6 stops) Co-Authored-By: Claude Opus 5.5 --- src/terminal.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/terminal.zig b/src/terminal.zig index 20a9a015..d4238c83 100644 --- a/src/terminal.zig +++ b/src/terminal.zig @@ -900,8 +900,10 @@ pub fn screenTextLen(pane: *Pane) usize { /// Release the emulator's heap. The Pane allocation itself is the core's. pub fn deinitEmulator(pane: *Pane, gpa: std.mem.Allocator) void { if (comptime !enabled) return; - if (authorityOnly("close a terminal")) return; + // A pane with none (a file's, a picker's, a preview's) closes in a + // speculation as anywhere. const state = pane.terminal orelse return; + if (authorityOnly("close a terminal")) return; if (comptime images_enabled) state.images.deinit(gpa); state.stream.deinit(); const own = state.gpa; -- cgit v1.3