From 3e247baef779d96bf50a1ca8250ffc9a5d78a923 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 13 Mar 2024 09:29:56 -0700 Subject: [PATCH] core: write scrollback file works again --- src/Surface.zig | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Surface.zig b/src/Surface.zig index f648d47d5..1fe23ae32 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -3230,11 +3230,14 @@ 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 - try self.io.terminal.screen.dumpString( - file.writer(), - .{ .history = .{} }, - ); + 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(), + .{ .tl = tl, .br = br, .unwrap = true }, + ); + } } // Get the final path