From 71db8be57c8803495add2cff58b70485ba48e53e Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 29 May 2012 14:08:28 +0200 Subject: [PATCH] vte: implement charset shift in/out This allows changing GL and GR to the values set in G0-G3. GL can also be set temporarily, GR currently does not have such a mode. Signed-off-by: David Herrmann --- src/vte.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/vte.c b/src/vte.c index 341d9b4..4c8717d 100644 --- a/src/vte.c +++ b/src/vte.c @@ -327,11 +327,11 @@ static void do_execute(struct kmscon_vte *vte, uint32_t ctrl) break; case 0x0e: /* SO */ /* Map G1 character set into GL */ - /* TODO */ + vte->gl = vte->g1; break; case 0x0f: /* SI */ - /* Map G0 character set into Gl */ - /* TODO */ + /* Map G0 character set into GL */ + vte->gl = vte->g0; break; case 0x11: /* XON */ /* Resume transmission */ @@ -374,11 +374,11 @@ static void do_execute(struct kmscon_vte *vte, uint32_t ctrl) break; case 0x8e: /* SS2 */ /* Temporarily map G2 into GL for next char only */ - /* TODO */ + vte->glt = vte->g2; break; case 0x8f: /* SS3 */ /* Temporarily map G3 into GL for next char only */ - /* TODO */ + vte->glt = vte->g3; break; case 0x9a: /* DECID */ /* Send device attributes response like ANSI DA */ @@ -585,11 +585,11 @@ static void do_esc(struct kmscon_vte *vte, uint32_t data) break; case 'N': /* SS2 */ /* Temporarily map G2 into GL for next char only */ - /* TODO */ + vte->glt = vte->g2; break; case 'O': /* SS3 */ /* Temporarily map G3 into GL for next char only */ - /* TODO */ + vte->glt = vte->g3; break; case 'Z': /* DECID */ /* Send device attributes response like ANSI DA */ @@ -599,6 +599,26 @@ static void do_esc(struct kmscon_vte *vte, uint32_t data) /* End control string */ /* nothing to do here */ break; + case '~': /* LS1R */ + /* Invoke G1 into GR */ + vte->gr = vte->g1; + break; + case 'n': /* LS2 */ + /* Invoke G2 into GL */ + vte->gl = vte->g2; + break; + case '}': /* LS2R */ + /* Invoke G2 into GR */ + vte->gr = vte->g2; + break; + case 'o': /* LS3 */ + /* Invoke G3 into GL */ + vte->gl = vte->g3; + break; + case '|': /* LS3R */ + /* Invoke G3 into GR */ + vte->gr = vte->g3; + break; default: log_debug("unhandled escape seq %u", data); }