diff options
Diffstat (limited to 'src/builtins.zig')
| -rw-r--r-- | src/builtins.zig | 18 |
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; |
