aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2023-02-07 20:00:59 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2023-02-07 20:00:59 +0100
commit211964d56ee00a7d46e251cbc150afb79138ae37 (patch)
tree50210c0a78492846ffd4da6a677d9b26d9eca8e5
parentf17abd25b376c292f783062ecf821453eaa9cc4c (diff)
downloadst-patched-211964d56ee00a7d46e251cbc150afb79138ae37.tar.bz2
st-patched-211964d56ee00a7d46e251cbc150afb79138ae37.tar.xz
st-patched-211964d56ee00a7d46e251cbc150afb79138ae37.zip
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 49357cc..134e724 100644
--- a/st.c
+++ b/st.c
@@ -2422,6 +2422,9 @@ check_control_code:
2422 * they must not cause conflicts with sequences. 2422 * they must not cause conflicts with sequences.
2423 */ 2423 */
2424 if (control) { 2424 if (control) {
2425 /* in UTF-8 mode ignore handling C1 control characters */
2426 if (IS_SET(MODE_UTF8) && ISCONTROLC1(u))
2427 return;
2425 tcontrolcode(u); 2428 tcontrolcode(u);
2426 /* 2429 /*
2427 * control codes are not shown ever 2430 * control codes are not shown ever