summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2023-02-07 20:00:59 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-05-08 00:49:25 +0200
commit3e1afae00450cf3ddadec904e3f37966bb866209 (patch)
treef9795e1c0d3f5305840031cde55e074656f235da
parent9b61c72d8d171ddb1dec59f4cbf728766d2cfc40 (diff)
ignore C1 control characters in UTF-8 mode
Ignore processing and printing C1 control characters in UTF-8 mode. These are in the range: 0x80 - 0x9f. By default in st the mode is set to UTF-8. This matches more the behaviour of xterm with the options -u8 or +u8 also. Also see the xterm resource "allowC1Printable". Let me know if this breaks something, in most cases I don't think so. As usual a very good reference is: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
-rw-r--r--st.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/st.c b/st.c
index 0b443b5..d4c7d22 100644
--- a/st.c
+++ b/st.c
@@ -2537,6 +2537,9 @@ check_control_code:
* they must not cause conflicts with sequences.
*/
if (control) {
+ /* in UTF-8 mode ignore handling C1 control characters */
+ if (IS_SET(MODE_UTF8) && ISCONTROLC1(u))
+ return;
tcontrolcode(u);
/*
* control codes are not shown ever