Ticket #39741

Interactive mode hangs when running on kitty

Open Date: 2019-11-11 01:21 Last Update: 2019-11-11 23:22

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
None
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

When running yash on kitty (https://github.com/kovidgoyal/kitty) in interactive mode, yash hangs as soon as an attempt is made to type any character. This happens because of kitty's terminfo containing, amongst other entries, ka1= (https://github.com/kovidgoyal/kitty/blob/master/terminfo/kitty.terminfo#L120). This causes yash to record that a zero-length character sequence is a valid key entry, which gets handled quite badly.

This terminfo looks strange and it might be invalid; I am not qualified to judge that. Regardless of whether it is, it would be nice if yash would handle it gracefully. The below patch lets yash just skip such entries.

  1. --- a/lineedit/terminfo.c
  2. +++ b/lineedit/terminfo.c
  3. @@ -545,7 +545,7 @@
  4. }
  5. for (size_t i = 0; i < sizeof keymap / sizeof *keymap; i++) {
  6. const char *seq = tigetstr(keymap[i].capability);
  7. - if (is_strcap_valid(seq))
  8. + if (is_strcap_valid(seq) && seq[0] != '\0')
  9. t = trie_set(t, seq, (trievalue_T) { .keyseq = keymap[i].keyseq });
  10. }

Ticket History (2/2 Histories)

2019-11-11 01:21 Updated by: hvdijk
  • New Ticket "Interactive mode hangs when running on kitty" created
2019-11-11 23:22 Updated by: magicant
  • Status Update from Open to Closed
  • Resolution Update from None to Fixed
Comment

Thank you for reporting the issue. I applied your patch in r4005 so the fix will be included in the next release.

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login