input: kitty: don’t treat zero-length utf8/utf32 strings as text

This is a regression introduced in 3215d54f31

Symptoms: e.g. arrow keys not working in vim/neovim
This commit is contained in:
Daniel Eklöf 2023-03-31 11:34:04 +02:00
parent deb43c8dc3
commit e71e7f5cf6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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;