summaryrefslogtreecommitdiff
path: root/src/terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-30 16:39:16 -0300
committerGabriel Schneider <[email protected]>2026-10-30 20:25:56 -0300
commit3b0b9844d01f607ac07630682e3b92d3f9a84bff (patch)
tree7538504f802b8f1ecdbe3b2d60383840969e244c /src/terminal.zig
parent05826d5148b8d75c32397380b9f64e0b3477e5bb (diff)
downloadpardes-3b0b9844d01f607ac07630682e3b92d3f9a84bff.tar.gz
pardes-3b0b9844d01f607ac07630682e3b92d3f9a84bff.zip
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 <[email protected]>
Diffstat (limited to 'src/terminal.zig')
-rw-r--r--src/terminal.zig4
1 files changed, 3 insertions, 1 deletions
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;