summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsasha <sasha.code@posteo.mx>2025-07-27 05:43:47 +0000
committerHiltjo Posthuma <hiltjo@codemadness.org>2025-07-27 20:06:54 +0200
commitf114bcedd113017d907aad32031db92c050f4bf3 (patch)
tree4cbd1eca84396af81b36ba1740b1aecc81e3ddc7
parentDo not interpret CSI ? u as DECRC (diff)
downloadst-f114bcedd113017d907aad32031db92c050f4bf3.tar.gz
st-f114bcedd113017d907aad32031db92c050f4bf3.zip
Eat up "CSI 58" sequences
This is used in the wild by systemd systemctl for example and st misinterpreted it as "blink", because it didn't know "58", then saw "5" as "blink", and then didn't know "245". This should print "foo" as normal text: printf '\e[58:5:245mfoo\n' printf '\e[58:2:50:100:200mfoo\n'
-rw-r--r--st.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/st.c b/st.c
index 03b9bc8..37f38c5 100644
--- a/st.c
+++ b/st.c
@@ -1430,6 +1430,12 @@ tsetattr(const int *attr, int l)
1430 case 49: 1430 case 49:
1431 term.c.attr.bg = defaultbg; 1431 term.c.attr.bg = defaultbg;
1432 break; 1432 break;
1433 case 58:
1434 /* This starts a sequence to change the color of
1435 * "underline" pixels. We don't support that and
1436 * instead eat up a following "5;n" or "2;r;g;b". */
1437 tdefcolor(attr, &i, l);
1438 break;
1433 default: 1439 default:
1434 if (BETWEEN(attr[i], 30, 37)) { 1440 if (BETWEEN(attr[i], 30, 37)) {
1435 term.c.attr.fg = attr[i] - 30; 1441 term.c.attr.fg = attr[i] - 30;