This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository terminology.

View the commit online.

commit f3de0686134bdf703ca86752811a891c9dc4953e
Author: Boris Faure <[email protected]>
AuthorDate: Sat Sep 12 16:06:51 2026 +0200

    termptyesc: ignore kitty keyboard sequences
    
    CSI ? u took the decoding-error path, noisy on every nvim 0.11 start.
    leaving it unanswered is better
---
 src/bin/termpty.c    | 25 +++++++++++++++++++++++++
 src/bin/termptyesc.c |  4 ++++
 src/bin/tytest.c     |  1 +
 src/bin/unit_tests.h |  1 +
 4 files changed, 31 insertions(+)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 238fdc13..ef044b93 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -2305,4 +2305,29 @@ tytest_xmodkeys_query(void)
    return 0;
 }
 
+/* Unanswered kitty sequences are how a client keeps to legacy encoding */
+int
+tytest_kitty_keyboard_ignored(void)
+{
+   Termpty ty;
+
+   _ty_test_init(&ty, 80, 24);
+
+   _ty_feed(&ty, "\x1b[?u");       /* query  */
+   _ty_feed(&ty, "\x1b[?0u");      /* query  */
+   _ty_feed(&ty, "\x1b[>1u");      /* push   */
+   _ty_feed(&ty, "\x1b[<1u");      /* pop    */
+   _ty_feed(&ty, "\x1b[=1;1u");    /* set    */
+
+   assert(ty.write_buffer.len == 0);
+
+   /* CSI u with no parameter is still a cursor restore. */
+   _ty_feed(&ty, "\x1b[10;20H\x1b[s\x1b[1;1H\x1b[u");
+   assert(ty.cursor_state.cx == 19);
+   assert(ty.cursor_state.cy == 9);
+
+   _ty_test_shutdown(&ty);
+   return 0;
+}
+
 #endif /* BINARY_TYFUZZ || BINARY_TYTEST */
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 104a4501..02de8172 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -3799,6 +3799,10 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
              // No parameter. Restore cursor pos
              termpty_cursor_copy(ty, EINA_FALSE);
           }
+        else if ((*b == '?') || (*b == '>') || (*b == '<') || (*b == '='))
+          {
+             DBG("ignoring kitty keyboard sequence");
+          }
         else
           {
              ERR("unhandled 'u' CSI escape code");
diff --git a/src/bin/tytest.c b/src/bin/tytest.c
index 8bfcba7c..701428dc 100644
--- a/src/bin/tytest.c
+++ b/src/bin/tytest.c
@@ -58,6 +58,7 @@ static struct {
        { "percent_decode", tytest_percent_decode},
        { "xmodkeys_set", tytest_xmodkeys_set},
        { "xmodkeys_query", tytest_xmodkeys_query},
+       { "kitty_keyboard_ignored", tytest_kitty_keyboard_ignored},
        { NULL, NULL},
 };
 
diff --git a/src/bin/unit_tests.h b/src/bin/unit_tests.h
index d6102444..c1dc6cb0 100644
--- a/src/bin/unit_tests.h
+++ b/src/bin/unit_tests.h
@@ -32,5 +32,6 @@ int tytest_sync_change_cb_altscreen(void);
 int tytest_percent_decode(void);
 int tytest_xmodkeys_set(void);
 int tytest_xmodkeys_query(void);
+int tytest_kitty_keyboard_ignored(void);
 
 #endif

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to