From a7e0bb04eaa913e64add2aa20736c743bdadce30 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 23 May 2022 15:25:22 -0700 Subject: [PATCH] on resize, set the terminal cursor to max --- src/terminal/Terminal.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/terminal/Terminal.zig b/src/terminal/Terminal.zig index baf3996f7..838d219bb 100644 --- a/src/terminal/Terminal.zig +++ b/src/terminal/Terminal.zig @@ -102,6 +102,10 @@ pub fn resize(self: *Terminal, alloc: Allocator, cols: usize, rows: usize) !void .top = 0, .bottom = rows - 1, }; + + // Move our cursor + self.cursor.x = @minimum(self.cursor.x, self.cols - 1); + self.cursor.y = @minimum(self.cursor.y, self.rows - 1); } /// Return the current string value of the terminal. Newlines are