summaryrefslogtreecommitdiff
path: root/console/display.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-10-22 14:38:28 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-10-22 14:38:28 +0200
commite1dff04f50833437c47cf1b737e69d3a73de9d63 (patch)
tree3853ff6e4cf06843e9ca6d139525eaaa8dce5aa7 /console/display.c
parent1cf9d9d1ee1b5bb9ea73208b9635252ab5d883fb (diff)
Make CUD more usual
Whether CUD scrolls the screen or not is implementation-dependant. Applications are not supposed to assume one way or the other, but they sometimes do, and most implementations do scroll, so let's stick to common practice. * console/display.c (handle_esc_bracket): On CUD/VPR, scroll the screen instead of capping the cursor position.
Diffstat (limited to 'console/display.c')
-rw-r--r--console/display.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/console/display.c b/console/display.c
index 97e16264..8d9e4786 100644
--- a/console/display.c
+++ b/console/display.c
@@ -1186,8 +1186,9 @@ handle_esc_bracket (display_t display, char op)
case 'B': /* ECMA-48 <CUD>. */
case 'e': /* ECMA-48 <VPR>. */
/* Cursor down: <cud1>, <cud>. */
- user->cursor.row += (parse->params[0] ?: 1);
- limit_cursor (display);
+ /* Most implementations scroll the screen. */
+ for (i = 0; i < (parse->params[0] ?: 1); i++)
+ linefeed (display);
break;
case 'C': /* ECMA-48 <CUF>. */
/* Cursor right: <cuf1>, <cuf>. */