Hi! I'm new here and I'm trying to make the output demo work in a GNOME terminal. The while loop in the main function clearly shows that it should exit when the ESC key is pressed, but it doesn't work. I always get a 0xFFFF as ev.key instead of TB_KEY_ESC.
I believe the problem is in the extract_event, which calls parse_escape_seq when the first character of the input buffer is ESC. The parse_escape_seq will then find this single-character buffer matches the first sequence in the keys array, which is F1.
I added a len > 1 condition above the call to parse_escape_seq as a workaround. Not sure if I've done anything wrong as such a fundamental feature should be broken.
Hi! I'm new here and I'm trying to make the output demo work in a GNOME terminal. The while loop in the main function clearly shows that it should exit when the ESC key is pressed, but it doesn't work. I always get a
0xFFFF
asev.key
instead ofTB_KEY_ESC
.I believe the problem is in the
extract_event
, which callsparse_escape_seq
when the first character of the input buffer isESC
. Theparse_escape_seq
will then find this single-character buffer matches the first sequence in thekeys
array, which isF1
.I added a
len > 1
condition above the call toparse_escape_seq
as a workaround. Not sure if I've done anything wrong as such a fundamental feature should be broken.