summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 11:22:53 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit1c3842f136b9f98fae784559ec12d66d629c5909 (patch)
tree9a53e64542e191b717052dbe5b5cd79cfd2c0754 /src/pardes.zig
parent5cf50930dee214fb641bb95bbf8639b8f76930d9 (diff)
downloadpardes-1c3842f136b9f98fae784559ec12d66d629c5909.tar.gz
pardes-1c3842f136b9f98fae784559ec12d66d629c5909.zip
Exit quits and Kill stops commands, as in acme
Kill quit the editor, which in acme is Exit; acme's Kill stops the commands it started. Exit now quits as acme's does (exec.c, rowclean): it refuses once, naming each pane with unsaved text, and quits when asked again with nothing edited since (a small scratch is not asked about). Kill, bare or with names, stops the commands pardes typed into a terminal (an exec, a middle click, a pty/run) while their shell's marks say they run, by SIGTERM to the terminal's foreground job, never to the shell (acme posts the kill note, which terminates). Both are session builtins; the topbar's Kill becomes Exit, same width, and every golden's topbar row changed by exactly that word (checked line by line); the builtins script scrolls one more row for the index's new line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 05f6710a..f3348ea5 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -561,7 +561,7 @@ test "startup config runs builtin lines in order and isolates bad lines" {
.startup_config =
\\Theme dark
\\DefinitelyNotABuiltin
- \\Kill trailing-garbage
+ \\Exit trailing-garbage
\\Theme no-such-theme
\\Theme acme
,
@@ -575,7 +575,7 @@ test "startup config runs builtin lines in order and isolates bad lines" {
for (0..p.effects_len) |i| switch (p.effects[(p.effects_head + i) % p.effects.len]) {
.write => |w| {
try std.testing.expect(std.mem.indexOf(u8, w.bytes.slice(), "DefinitelyNotABuiltin") == null);
- try std.testing.expect(std.mem.indexOf(u8, w.bytes.slice(), "Kill") == null);
+ try std.testing.expect(std.mem.indexOf(u8, w.bytes.slice(), "Exit") == null);
},
else => {},
};
@@ -668,10 +668,10 @@ test "pane-tag Exec prefers Tty and argument builtins before shell fallback" {
else => {},
};
- // Fixed-name builtins remain exact: a tail does not turn New or Kill into
+ // Fixed-name builtins remain exact: a tail does not turn New or Exit into
// a match (especially important for the destructive one).
try std.testing.expect(!p.executeBuiltinLine(0, "New argument"));
- try std.testing.expect(!p.executeBuiltinLine(0, "Kill trailing-garbage"));
+ try std.testing.expect(!p.executeBuiltinLine(0, "Exit trailing-garbage"));
try std.testing.expect(!p.quit);
// A word absent from the builtin vocabulary takes the fallback, including
@@ -3083,7 +3083,9 @@ pub const AttachRequest = struct { pane: u8, name: []const u8 };
pub const PendingWrite = struct { bytes: []u8, off: usize = 0 };
-pub const PtySignal = enum(u8) { int, term, hup, quit, kill };
+/// `command` is Kill's: SIGTERM to the terminal's foreground job, and never
+/// to the shell itself when the shell is in the foreground.
+pub const PtySignal = enum(u8) { int, term, hup, quit, kill, command };
/// IO the core wants done. Payloads are inline (fixed buffers): effects are
/// queued values with no lifetime ties back into the core.