[dev] [st][PATCH 1/3] Fix SI and SO

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Wed, 8 Oct 2014 11:43:06 +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 | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/st.c b/st.c
index c90bed1..19e4379 100644
--- a/st.c
+++ b/st.c
_AT_@ -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);
-- 
1.9.3
Received on Wed Oct 08 2014 - 11:43:06 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 08 2014 - 11:48:07 CEST