core: only dump scrollback contents if there is scrollback

Fixes #1353
This commit is contained in:
Mitchell Hashimoto
2024-01-21 20:55:41 -08:00
parent 23cd77884d
commit 2c924be9b1

View File

@ -2933,11 +2933,16 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
&self.io.terminal.screen, &self.io.terminal.screen,
); );
try self.io.terminal.screen.dumpString(file.writer(), .{ // We only dump history if we have history. We still keep
.start = .{ .history = 0 }, // the file and write the empty file to the pty so that this
.end = .{ .history = history_max -| 1 }, // command always works on the primary screen.
.unwrap = true, if (history_max > 0) {
}); try self.io.terminal.screen.dumpString(file.writer(), .{
.start = .{ .history = 0 },
.end = .{ .history = history_max -| 1 },
.unwrap = true,
});
}
} }
// Get the final path // Get the final path