From fe075ea7957c1e21957a0eadd70e8a73d21c74cd Mon Sep 17 00:00:00 2001 From: pagedown Date: Wed, 17 Nov 2021 23:00:27 +0800 Subject: [PATCH] Unset the last visited command output position --- kitty/screen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/screen.c b/kitty/screen.c index 02141bb77..67504027b 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -1269,7 +1269,10 @@ screen_cursor_to_column(Screen *self, unsigned int column) { linebuf_init_line(self->linebuf, bottom); \ historybuf_add_line(self->historybuf, self->linebuf->line, &self->as_ansi_buf); \ self->history_line_added_count++; \ - if (self->last_visited_prompt.is_set && self->last_visited_prompt.scrolled_by <= self->historybuf->count) self->last_visited_prompt.scrolled_by++; \ + if (self->last_visited_prompt.is_set) { \ + if (self->last_visited_prompt.scrolled_by < self->historybuf->count) self->last_visited_prompt.scrolled_by++; \ + else self->last_visited_prompt.is_set = false; \ + } \ } \ linebuf_clear_line(self->linebuf, bottom, true); \ self->is_dirty = true; \