diff options
Diffstat (limited to 'src/parser.c')
-rw-r--r-- | src/parser.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parser.c b/src/parser.c index 41f66df..94406ea 100644 --- a/src/parser.c +++ b/src/parser.c @@ -2584,6 +2584,14 @@ static void vt100_parser_handle_cup(VT100Screen *vt, char *buf, size_t len) if (params[1] == 0) { params[1] = 1; } + /* this needs to be fixed up here (and not in screen.c) because CUP hsould + * never cause scrolling */ + if (params[0] > vt->grid->max.row) { + params[0] = vt->grid->max.row; + } + if (params[1] > vt->grid->max.col) { + params[1] = vt->grid->max.col; + } vt100_screen_move_to(vt, params[0] - 1, params[1] - 1); } |