mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
fix(termio/exec): avoid overflow in setCursorRow/ColRelative
Using a saturating addition here just to avoid overflow, since setCursorPos handles proper clamping to the screen size so we don't need to duplicate that logic.
This commit is contained in:
@ -1993,7 +1993,7 @@ const StreamHandler = struct {
|
|||||||
pub fn setCursorColRelative(self: *StreamHandler, offset: u16) !void {
|
pub fn setCursorColRelative(self: *StreamHandler, offset: u16) !void {
|
||||||
self.terminal.setCursorPos(
|
self.terminal.setCursorPos(
|
||||||
self.terminal.screen.cursor.y + 1,
|
self.terminal.screen.cursor.y + 1,
|
||||||
self.terminal.screen.cursor.x + 1 + offset,
|
self.terminal.screen.cursor.x + 1 +| offset,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2003,7 +2003,7 @@ const StreamHandler = struct {
|
|||||||
|
|
||||||
pub fn setCursorRowRelative(self: *StreamHandler, offset: u16) !void {
|
pub fn setCursorRowRelative(self: *StreamHandler, offset: u16) !void {
|
||||||
self.terminal.setCursorPos(
|
self.terminal.setCursorPos(
|
||||||
self.terminal.screen.cursor.y + 1 + offset,
|
self.terminal.screen.cursor.y + 1 +| offset,
|
||||||
self.terminal.screen.cursor.x + 1,
|
self.terminal.screen.cursor.x + 1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user