feat: add save_session_quiet command and make save_session verbose

This commit is contained in:
CJ van den Berg 2025-12-06 21:46:09 +01:00
parent 921c17de3c
commit 719eed4cfd
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -356,10 +356,19 @@ const cmds = struct {
pub const quit_without_saving_meta: Meta = .{ .description = "Quit without saving" };
pub fn save_session(self: *Self, _: Ctx) Result {
const logger = log.logger("session");
defer logger.deinit();
logger.print("saving session...", .{});
try self.write_restore_info();
logger.print("session saved", .{});
}
pub const save_session_meta: Meta = .{ .description = "Save session" };
pub fn save_session_quiet(self: *Self, _: Ctx) Result {
try self.write_restore_info();
}
pub const save_session_quiet_meta: Meta = .{};
pub fn save_session_and_quit(self: *Self, _: Ctx) Result {
try self.write_restore_info();
try tp.self_pid().send("quit");