aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-06-24 18:05:24 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-06-24 18:05:24 +0000
commitd4b6bc77d5ab857bd951c36d2dfd8d8c75625359 (patch)
treee47b0b9f49cadec892a75889e42b056d44762b37 /csi.c
parentcsi: implement "send device attributes" (diff)
csi: VPA: saturate row
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/csi.c b/csi.c
index a2633e12..db2d332f 100644
--- a/csi.c
+++ b/csi.c
@@ -247,10 +247,14 @@ csi_dispatch(struct terminal *term, uint8_t final)
return write(term->ptmx, "\033[?6c", 5) == 5;
case 'd': {
+ /* VPA - vertical line position absolute */
int row = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
if (row == 0)
row = 1;
+ if (row > term->grid.rows)
+ row = term->grid.rows;
+
grid_cursor_to(&term->grid, row - 1, term->grid.cursor.col);
break;
}