core: write scrollback file works again

This commit is contained in:
Mitchell Hashimoto
2024-03-13 09:29:56 -07:00
parent 992c736986
commit 3e247baef7

View File

@ -3230,12 +3230,15 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
// We only dump history if we have history. We still keep
// the file and write the empty file to the pty so that this
// command always works on the primary screen.
// TODO(paged-terminal): unwrap
const pages = &self.io.terminal.screen.pages;
if (pages.getBottomRight(.history)) |br| {
const tl = pages.getTopLeft(.history);
try self.io.terminal.screen.dumpString(
file.writer(),
.{ .history = .{} },
.{ .tl = tl, .br = br, .unwrap = true },
);
}
}
// Get the final path
var path_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;