This is a first small step toward supporting Kitty terminal graphics protocol as it uses APC sequences, and fixes e.g. characters being incorrectly shown on screen when returning from yazi(see below video), since that program probes for Kitty support by writing an APC sequence that is either handled (by terminals supporting the kitty graphics protocol) or should be ignored (by terminals not supporting it, which we here also start doing as well).
Parse Application Program-Control (APC) terminal escape sequences - sequences starting with
ESC _
and ending withESC \
(String Terminator, ST).Reference: https://www.xfree86.org/current/ctlseqs.html
This is a first small step toward supporting Kitty terminal graphics protocol as it uses APC sequences, and fixes e.g. characters being incorrectly shown on screen when returning from
yazi
(see below video), since that program probes for Kitty support by writing an APC sequence that is either handled (by terminals supporting the kitty graphics protocol) or should be ignored (by terminals not supporting it, which we here also start doing as well).https://github.com/user-attachments/assets/7ad66f5c-2dd0-40e0-83be-e7a7afcd143d