From e71e7f5cf6452e9f14dd93a72ed9afca98ea13b3 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 31 Mar 2023 11:34:04 +0200 Subject: input: kitty: don’t treat zero-length utf8/utf32 strings as text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a regression introduced in 3215d54f31c9e339598a34c9fa43f3dc3c5d1e42 Symptoms: e.g. arrow keys not working in vim/neovim --- input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'input.c') diff --git a/input.c b/input.c index b7f25670..7e5d204d 100644 --- a/input.c +++ b/input.c @@ -1125,7 +1125,7 @@ kitty_kbd_protocol(struct seat *seat, struct terminal *term, const uint8_t *const utf8 = ctx->utf8.buf; const size_t count = ctx->utf8.count; - bool is_text = utf32 != NULL && (effective & ~caps_num) == 0; + bool is_text = count > 0 && utf32 != NULL && (effective & ~caps_num) == 0; for (size_t i = 0; utf32[i] != U'\0'; i++) { if (!iswprint(utf32[i])) { is_text = false; -- cgit v1.3