diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-06-24 18:08:44 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-06-24 18:08:44 +0000 |
| commit | da0a65d4999133928a160a282a6f0496ff6d0af7 (patch) | |
| tree | af1209f9da4dca1c20b5bca6e4913f313ea76f8f | |
| parent | csi: implement VPR (vertical line position relative) (diff) | |
csi: implement cursor horizontal absolute
| -rw-r--r-- | csi.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -295,6 +295,19 @@ csi_dispatch(struct terminal *term, uint8_t final) break; } + case 'G': { + /* Cursor horizontal absolute */ + int col = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1; + if (col == 0) + col = 1; + + if (col > term->grid.cols) + col = term->grid.cols; + + grid_cursor_to(&term->grid, term->grid.cursor.row, col); + break; + } + case 'H': { /* Move cursor */ int row = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1; |
