From 9b058b1f9040fae51102b18a3c2f13f08c8df8a0 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 5 Feb 2012 15:45:43 +0100 Subject: [PATCH] vte: implement basic cursor-movement controls This adds support for line-feed and carriage-return controls. The two special line-feed controls which are not \n do not take care NL-mode so they must be handled separately. Signed-off-by: David Herrmann --- src/vte.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vte.c b/src/vte.c index 1514527..c823247 100644 --- a/src/vte.c +++ b/src/vte.c @@ -157,13 +157,17 @@ static void parse_control(struct kmscon_vte *vte, uint32_t ctrl) /* Move to next tab stop or end of line */ break; case 0x0a: /* LF */ - case 0x0b: /* VT */ - case 0x0c: /* FF */ /* Line feed or newline (CR/NL mode) */ kmscon_console_newline(vte->con); break; + case 0x0b: /* VT */ + case 0x0c: /* FF */ + /* Line feed */ + kmscon_console_move_down(vte->con, 1, true); + break; case 0x0d: /* CR */ /* Move cursor to left margin */ + kmscon_console_move_line_home(vte->con); break; case 0x0e: /* SO */ /* Invoke G1 character set */