summaryrefslogtreecommitdiff
path: root/src/config.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/config.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/config.zig')
-rw-r--r--src/config.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/config.zig b/src/config.zig
index f898df11..6d0cf0a6 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -49,6 +49,7 @@ pub const leader_path = paths: {
.Togglettymode = null,
.Collapse = null,
.Kill = null,
+ .Exit = null,
.ClipYank = "y",
.ClipYankMain = "Y",
.ClipPaste = "p",
@@ -160,8 +161,9 @@ pub const leader_path = paths: {
break :paths table;
};
-test "Space-k is unbound while Kill and other k chords remain available" {
+test "Space-k is unbound while Exit, Kill and other k chords remain available" {
try std.testing.expect(leader_path.get(.Kill) == null);
+ try std.testing.expect(leader_path.get(.Exit) == null);
try std.testing.expectEqualStrings("wk", leader_path.get(.Up).?);
try std.testing.expectEqualStrings("lk", leader_path.get(.Hover).?);
try std.testing.expectEqualStrings("d", leader_path.get(.Del).?);
@@ -183,7 +185,10 @@ test "Space-k is unbound while Kill and other k chords remain available" {
while (p.nextEffect()) |effect| try std.testing.expect(effect != .quit);
p.update(.{ .key = .{ .cp = 'k' } });
try std.testing.expectEqual(@as(i32, 0), pane.body.cur_row);
+ // Kill stops commands and never quits; Exit quits.
try std.testing.expect(p.executeBuiltinLine(p.active, "Kill"));
+ try std.testing.expect(!p.quit);
+ try std.testing.expect(p.executeBuiltinLine(p.active, "Exit"));
try std.testing.expect(p.quit);
}
@@ -237,7 +242,7 @@ pub const child_term = "xterm-256color";
pub const child_colorterm = "truecolor";
pub const child_term_program = "pardes";
-pub const topbar_str = "Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill";
+pub const topbar_str = "Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Exit";
pub const pane_builtins_str = "Tty Collapse Del";
pub const pdf_pane_builtins_str = "Tty PdfSections PdfTint Collapse Del";