summaryrefslogtreecommitdiff
path: root/src/Core.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core.zig')
-rw-r--r--src/Core.zig25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/Core.zig b/src/Core.zig
index 6c5f5470..2e17b495 100644
--- a/src/Core.zig
+++ b/src/Core.zig
@@ -177,7 +177,6 @@ pub const View = struct {
clip_pending: ?edit.ClipRequest = null,
};
-
gpa: std.mem.Allocator,
image_gpa: std.mem.Allocator,
/// Its kinds of pane (Kind.zig): the compiled-in ones, then what addons
@@ -402,18 +401,19 @@ diff_output: pardes.panes.File.DiffOutput = .{},
pub const replica = .{
.local = .{
// A frame, and the timings that make it.
- "surface", "frames", "chrome",
- "frame_arena", "scratch",
- "needs_frame", "present_skipped",
- "echo",
+ "surface", "frames", "chrome",
+ "frame_arena", "scratch", "needs_frame",
+ "present_skipped", "echo",
// Drained by every pump before its digest; a replica's queues
// are its own.
- "effects", "effects_head", "effects_len", "in_q", "in_head", "in_len",
+ "effects",
+ "effects_head", "effects_len", "in_q",
+ "in_head", "in_len",
// The views no frontend here draws (views.zig).
- "undrawn",
+ "undrawn",
// How this process was started, and the last dump it made for
// its host to write: a session loaded elsewhere has its own.
- "opts", "dump_out", "dump_export",
+ "opts", "dump_out", "dump_export",
},
.derived = .{ "shell_rows", "diff_output", "locations_cache", "retired_panes", "tty_filter_palette", "body_chrome" },
// The host's handles, the 9P server's fids and log, the state file
@@ -801,6 +801,15 @@ pub fn deinit(p: *Pardes) void {
gpa.destroy(p);
}
+/// The session ends: what it was goes to the state file (dump.dumpExit),
+/// then the host's loop sees `quit`. Every way out comes here: Exit, the
+/// last pane's Del, the host's own end (its terminal hung up, its window
+/// closed). A dump that fails is said as Exit's, in the log.
+pub fn endSession(p: *Pardes) void {
+ pardes.dump.dumpExit(p) catch |err| p.reportError(p.view().active, "Exit", err);
+ p.quit = true;
+}
+
/// shell feedback after write_dump: remember where the dump landed (the
/// topbar grows a `Restore <path>` word pointing at it)
pub fn setLastDump(p: *Pardes, path: []const u8) void {