From c343e6cef299d8d7bbc092de7393c9f9bbe2ddd5 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 29 Feb 2012 17:21:53 +0100 Subject: [PATCH] vte: add 8bit C1 7bit equivalents (dummy) Many 8bit C1 codes have 7bit escape sequences as equivalents. This adds handlers for all of them with comments what they are supposed to do. They are dummies for now but they will be implemented later. Signed-off-by: David Herrmann --- src/vte.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/vte.c b/src/vte.c index 6243078..a99862c 100644 --- a/src/vte.c +++ b/src/vte.c @@ -272,6 +272,8 @@ static void do_execute(struct kmscon_vte *vte, uint32_t ctrl) /* End control string */ /* nothing to do here */ break; + default: + log_warn("vte: unhandled control char %u\n", ctrl); } } @@ -284,6 +286,10 @@ static void do_clear(struct kmscon_vte *vte) vte->csi_argv[i] = -1; } +static void do_collect(struct kmscon_vte *vte, uint32_t data) +{ +} + static void do_param(struct kmscon_vte *vte, uint32_t data) { int new; @@ -311,6 +317,46 @@ static void do_param(struct kmscon_vte *vte, uint32_t data) } } +static void do_esc(struct kmscon_vte *vte, uint32_t data) +{ + switch (data) { + case 'D': /* IND */ + /* Move down one row, perform scroll-up if needed */ + /* TODO */ + break; + case 'E': /* NEL */ + /* CR/NL with scroll-up if needed */ + /* TODO */ + break; + case 'H': /* HTS */ + /* Set tab stop at current position */ + /* TODO */ + break; + case 'M': /* RI */ + /* Move up one row, perform scroll-down if needed */ + /* TODO */ + break; + case 'N': /* SS2 */ + /* Temporarily map G2 into GL for next char only */ + /* TODO */ + break; + case 'O': /* SS3 */ + /* Temporarily map G3 into GL for next char only */ + /* TODO */ + break; + case 'Z': /* DECID */ + /* Send device attributes response like ANSI DA */ + /* TODO*/ + break; + case '\\': /* ST */ + /* End control string */ + /* nothing to do here */ + break; + default: + log_warn("vte: unhandled escape seq %u\n", data); + } +} + static void do_csi(struct kmscon_vte *vte, uint32_t data) { int num; @@ -387,11 +433,13 @@ static void do_action(struct kmscon_vte *vte, uint32_t data, int action) do_clear(vte); break; case ACTION_COLLECT: + do_collect(vte, data); break; case ACTION_PARAM: do_param(vte, data); break; case ACTION_ESC_DISPATCH: + do_esc(vte, data); break; case ACTION_CSI_DISPATCH: do_csi(vte, data);