Hi,

On Sun, Jan 26, 2025 at 01:40:57PM +0100, Johannes Altmanninger wrote:
> 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'.

I took a look to the history of the code, and this comes from the very
early times of st, before I began to collaborate in the project.
It seems that st in honouring some escape sequences used by the old
MS-DOS ANSY.SYS driver, and I am not sure why we should try to
accept any ANSY.SYS sequences at all. I suppose this was done to be able
to connect to some old bbs that hardcoded the sequences to the one
used by ANSY.SYS.

I personally think we should remove that, as the only way to get
the correct output is checking the terminfo entry using the TERM
variable, and as we didn't care anymore about ansy.sys is likely
that we are not able to pretend that we understand it anymore.

In this specific case, for DECRC, we have the vt100 escape sequences
in ESC 8, that is the sequence that I suppose any other terminal use
(I checked the official documentation of the vt100 and the vt510).

Regards,

Reply via email to