aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2023-03-31 09:34:04 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-03-31 09:34:04 +0000
commite71e7f5cf6452e9f14dd93a72ed9afca98ea13b3 (patch)
tree0b590e56a2b0dd507cebf55c76e0e2702b811e68 /input.c
parentchangelog: typo: now -> not (diff)
input: kitty: don’t treat zero-length utf8/utf32 strings as text
This is a regression introduced in 3215d54f31c9e339598a34c9fa43f3dc3c5d1e42 Symptoms: e.g. arrow keys not working in vim/neovim
Diffstat (limited to 'input.c')
-rw-r--r--input.c2
1 files changed, 1 insertions, 1 deletions
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;