terminal: cursor position report respects left scroll region with origin

This commit is contained in:
Mitchell Hashimoto
2023-10-15 21:58:13 -07:00
parent 313eec0c7d
commit 7b81eba565
2 changed files with 47 additions and 2 deletions

View File

@@ -1611,8 +1611,7 @@ const StreamHandler = struct {
x: usize,
y: usize,
} = if (self.terminal.modes.get(.origin)) .{
// TODO: what do we do if cursor is outside scrolling region?
.x = self.terminal.screen.cursor.x,
.x = self.terminal.screen.cursor.x -| self.terminal.scrolling_region.left,
.y = self.terminal.screen.cursor.y -| self.terminal.scrolling_region.top,
} else .{
.x = self.terminal.screen.cursor.x,