diff options
Diffstat (limited to 'src/terminal.zig')
| -rw-r--r-- | src/terminal.zig | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/terminal.zig b/src/terminal.zig index 1a3b6a21..4cac6f1d 100644 --- a/src/terminal.zig +++ b/src/terminal.zig @@ -1044,9 +1044,14 @@ pub fn commandOutput(pane: *Pane, gpa: std.mem.Allocator, max_rows: usize) !Comm const screen = state.vt.screens.get(.primary) orelse break :printed false; if (end.garbage) break :printed false; var whole = !marks.lost and !start.garbage; + // Nothing printed: the whole of it. + if (start.eql(end.*)) break :printed whole; // D is where the next prompt begins: the output ends a cell before. - const last = end.leftWrap(1) orelse break :printed whole; - if (start.eql(end.*) or last.before(start.*)) break :printed whole; + // An end at the very top, or before the start, is output a redraw + // moved (a prompt drawn over it in a window two rows high): how + // much is not known, so it is not called whole. + const last = end.leftWrap(1) orelse break :printed false; + if (last.before(start.*)) break :printed false; var from = start.*; if (last.up(max_rows)) |floor| if (from.before(floor)) { from = floor; |
