aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2014-10-08 10:30:20 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-10-08 11:28:54 +0200
commit0c8feecbf74674132070169986802c75dd49d688 (patch)
tree4e7e477077c1734e421c9c97a880e5c92a98e834
parenta7eef8f230bcf72a85af68fc9a08ca94e52ca18d (diff)
downloadst-0c8feecbf74674132070169986802c75dd49d688.tar.gz
st-0c8feecbf74674132070169986802c75dd49d688.tar.bz2
Fix SI and SO
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.
-rw-r--r--st.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/st.c b/st.c
index c90bed1..19e4379 100644
--- 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);