]> git.armaanb.net Git - st.git/commitdiff
Fix SI and SO
authorRoberto E. Vargas Caballero <k0ga@shike2.com>
Wed, 8 Oct 2014 08:30:20 +0000 (10:30 +0200)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Wed, 8 Oct 2014 09:28:54 +0000 (11:28 +0200)
SI (0x0F or ^O) means Shift In, and it selects G1 charset definition,
and SO (0x0E or ^N) means Shift Out, and it selects G0 charset
definition, but st was doing just the inverse.

st.c

diff --git a/st.c b/st.c
index c90bed1746e84104d77497f6006d772d4ecc0e2c..19e4379228c707610f7d9e8663352b57e4a0267b 100644 (file)
--- a/st.c
+++ b/st.c
@@ -2431,11 +2431,9 @@ tcontrolcode(uchar ascii) {
                term.esc &= ~(ESC_CSI|ESC_ALTCHARSET|ESC_TEST);
                term.esc |= ESC_START;
                return;
-       case '\016': /* SO */
-               term.charset = 0;
-               return;
-       case '\017': /* SI */
-               term.charset = 1;
+       case '\016': /* SO (LS1 -- Locking shift 1) */
+       case '\017': /* SI (LS0 -- Locking shift 0) */
+               term.charset = 1 - (ascii - '\016');
                return;
        case '\032': /* SUB */
                tsetchar(question, &term.c.attr, term.c.x, term.c.y);