From a5a357e012d175397c028606e48cc9c579b5c1dc Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 5 Feb 2012 15:52:34 +0100 Subject: [PATCH] vte: implement CSI-K The K CSI is used to erase parts of the current line. Signed-off-by: David Herrmann --- src/vte.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vte.c b/src/vte.c index c823247..1bbfe6b 100644 --- a/src/vte.c +++ b/src/vte.c @@ -237,6 +237,15 @@ static void parse_csi(struct kmscon_vte *vte, uint32_t val) vte->parser.state = STATE_NORMAL; switch (val) { + case 'K': + if (vte->parser.csi_argc < 1 || + vte->parser.csi_argv[0] == 0) + kmscon_console_erase_cursor_to_end(vte->con); + else if (vte->parser.csi_argv[0] == 1) + kmscon_console_erase_home_to_cursor(vte->con); + else if (vte->parser.csi_argv[0] == 2) + kmscon_console_erase_current_line(vte->con); + break; default: log_debug("vte: unhandled CSI sequence\n"); }