delete history file after running less

This commit is contained in:
Danny Lin
2024-06-07 03:03:06 -07:00
parent 9e71847c25
commit 23c12c895b

View File

@ -3235,7 +3235,7 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
const path = try tmp_dir.dir.realpath("scrollback", &path_buf); const path = try tmp_dir.dir.realpath("scrollback", &path_buf);
var cmd_buf: [std.fs.MAX_PATH_BYTES + 1024]u8 = undefined; var cmd_buf: [std.fs.MAX_PATH_BYTES + 1024]u8 = undefined;
const cmd = try std.fmt.bufPrint(&cmd_buf, "\nless --chop-long-lines --RAW-CONTROL-CHARS +G {s}\n?", .{path}); const cmd = try std.fmt.bufPrint(&cmd_buf, "\nless --chop-long-lines --RAW-CONTROL-CHARS +G '{s}'; rm -f '{s}'\n?", .{ path, path });
_ = self.io_thread.mailbox.push(try termio.Message.writeReq( _ = self.io_thread.mailbox.push(try termio.Message.writeReq(
self.alloc, self.alloc,