mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
on resize, make sure we resize the alt screen too
This commit is contained in:
@ -346,6 +346,10 @@ pub fn resize(self: *Screen, alloc: Allocator, rows: usize, cols: usize) !void {
|
||||
self.rows = rows;
|
||||
self.cols = cols;
|
||||
|
||||
// Move our cursor if we have to so it stays on the screen.
|
||||
self.cursor.x = @minimum(self.cursor.x, self.cols - 1);
|
||||
self.cursor.y = @minimum(self.cursor.y, self.rows - 1);
|
||||
|
||||
// TODO: reflow due to soft wrap
|
||||
|
||||
// If we're increasing height, then copy all rows (start at 0).
|
||||
|
@ -156,6 +156,7 @@ pub fn resize(self: *Terminal, alloc: Allocator, cols: usize, rows: usize) !void
|
||||
// If we're making the screen smaller, dealloc the unused items.
|
||||
// TODO: reflow
|
||||
try self.screen.resize(alloc, rows, cols);
|
||||
try self.secondary_screen.resize(alloc, rows, cols);
|
||||
|
||||
// Set our size
|
||||
self.cols = cols;
|
||||
@ -166,10 +167,6 @@ pub fn resize(self: *Terminal, alloc: Allocator, cols: usize, rows: usize) !void
|
||||
.top = 0,
|
||||
.bottom = rows - 1,
|
||||
};
|
||||
|
||||
// Move our cursor
|
||||
self.screen.cursor.x = @minimum(self.screen.cursor.x, self.cols - 1);
|
||||
self.screen.cursor.y = @minimum(self.screen.cursor.y, self.rows - 1);
|
||||
}
|
||||
|
||||
/// Return the current string value of the terminal. Newlines are
|
||||
|
Reference in New Issue
Block a user