diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-06-24 17:40:00 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-06-24 17:40:00 +0000 |
| commit | 44206b49d4fc54fdd38aa9eee24eab5de1759dfb (patch) | |
| tree | 1018ec20cfedd53d8634ec40872038ae79d25a5f | |
| parent | TIOCSWINSZ: fix alignment and spelling (diff) | |
csi: saturate row/col when setting cursor position
| -rw-r--r-- | csi.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -291,6 +291,11 @@ csi_dispatch(struct terminal *term, uint8_t final) if (col == 0) col = 1; + if (row > term->grid.rows) + row = term->grid.rows; + if (col > term->grid.cols) + col = term->grid.cols; + grid_cursor_to(&term->grid, row - 1, col - 1); break; } @@ -384,7 +389,6 @@ csi_dispatch(struct terminal *term, uint8_t final) &term->grid, term->grid.cursor.row - term->grid.scrolling_region.start, count); - grid_cursor_to(&term->grid, term->grid.cursor.row, 0); break; } |
