summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-09 23:15:39 -0300
committerGabriel Schneider <[email protected]>2026-11-09 23:15:53 -0300
commit0b4cfd4b416d03ef64ccd908dfee810c6a498569 (patch)
tree83da4851e30b4dd0e788b66f0024d5b55eaee421 /src/builtins.zig
parent7e6fc8c9f62bc3dc08e24856cc647fa0adefb32c (diff)
downloadpardes-0b4cfd4b416d03ef64ccd908dfee810c6a498569.tar.gz
pardes-0b4cfd4b416d03ef64ccd908dfee810c6a498569.zip
a session's end leaves a slim dump and History lists them, the tags gain Follow, History and the window's Fonts: every way out (Exit, the last pane's Del, the host's quit) runs Pardes.endSession, which puts a dump of the session in the state file under the usual label before quitting, slim by the dump's own means (dumpJoin's slim_terminals, and Store's slim-file swap now a Slim struct: no undo, a clean file's text read from its file again by revivePane, a terminal a size for a new shell), none for a session of shells alone; the dump's image carries the panes' names, which /dumps rows end with; the History builtin (SPC f h) lists the state file's dumps in a +History pane and a look at a row is a Restore of its label; the default tags: Follow after Collapse on text panes, History before Debug on the workspace row, Fonts after Themes in a window's view alone (tagline.topbarDefault picks the row per view; both rows are known defaults to the docs and tutor tests); the tty goldens re-recorded (the new words; a narrow pane's tag wraps to a second row, so its body rows shift), builtins JSON regenerated
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index e021dd6b..1356874a 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -405,7 +405,7 @@ pub const Exit = struct {
pub const scope: Scope = .session;
pub fn run(c: Ctx) void {
if (warnModifiedIn(c, .Exit, .all)) return;
- c.p.quit = true;
+ c.p.endSession();
c.p.emit(.quit);
}
};
@@ -1700,6 +1700,22 @@ pub const Recent = struct {
}
};
+/// List the state file's dumps, those Dump made and those every session's
+/// end left (dump.dumpExit), the newest first: a row each, its label,
+/// date, size, pane count and the panes' names; a look at a row is a
+/// Restore of its label.
+pub const History = struct {
+ pub const scope: Scope = .session;
+ pub const output: OutputTraits = .{ .name = config.history_buffer };
+ pub fn run(c: Ctx) void {
+ panes.Output.openHistory(c.p, c.id) catch |err| switch (err) {
+ error.NoStateFile => c.p.reportFailure(c.id, "History: no state file to list (DumpDir)"),
+ error.NoDumps => c.p.reportFailure(c.id, "History: no dumps yet"),
+ else => c.p.reportError(c.id, "History", err),
+ };
+ }
+};
+
/// List the places jumped from, each a place to go.
pub const Jumplist = struct {
pub const scope: Scope = .session;