Do not interpret CSI ? u as DECRCmaster
commit98610fcd37f655d44586323dc86c1d013c2798ce
authorJohannes Altmanninger <aclopte@gmail.com>
Sun, 26 Jan 2025 12:40:57 +0000 (26 13:40 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Thu, 30 Jan 2025 16:50:37 +0000 (30 17:50 +0100)
tree23be46d7d1350efe6404ff8ba506b68aeb6d2ad2
parent6009e6e25bdff9548f085e9ae562b1ca305d3a0b
Do not interpret CSI ? u as DECRC

The kitty keyboard protocol docs recommend CSI ? u to query support for
that protocol, see https://sw.kovidgoyal.net/kitty/keyboard-protocol/

For better or worse, fish shell uses this query to work around bugs
in other terminals triggered by requesting that protocol via CSI = 5 u.

Unfortunately, st interprets CSI ? u as DECRC (restore cursor
position). reproduce with 'printf "\x1b[?u"; cat'.

fish could work around this by switching to the alternate screen
before running this query; but that might cause tearing on terminals
that don't support Synchronized Output. I'm not sure.

In the meantime, let's correct our parser.

This adds a redundant else-after-return, for consistency with the
surrounding code.
st.c