Closed dankamongmen closed 2 years ago
this was seen in Alacritty. i'm not sure if it happens everywhere else, particularly Kitty. also, see #2646 .
this does not appear to happen with Kitty. so it's probably closely related to #2646.
looping starts here:
block_on_input:2461:poll returned 1
block_on_input:2479:got events: tI
read_input_nblock:2091:read 1B from 0 (8191B left)
process_melange:2293:input 0 (0)/1 [0x1b] ( )
process_escape:2128:initialized automaton to 1
block_on_input:2377:blocking on input availability
block_on_input:2381:nonblocking read to check for completion
block_on_input:2434:waiting on 1 fds (ibuf: 1/8192)
block_on_input:2461:poll returned 0
block_on_input:2479:got events: ti
process_melange:2293:input 0 (1)/1 [0x1b] ( )
block_on_input:2377:blocking on input availability
block_on_input:2381:nonblocking read to check for completion
block_on_input:2434:waiting on 1 fds (ibuf: 1/8192)
block_on_input:2461:poll returned 0
block_on_input:2479:got events: ti
process_melange:2293:input 0 (1)/1 [0x1b] ( )
block_on_input:2377:blocking on input availability
block_on_input:2381:nonblocking read to check for completion
block_on_input:2434:waiting on 1 fds (ibuf: 1/8192)
block_on_input:2461:poll returned 0
block_on_input:2479:got events: ti
process_melange:2293:input 0 (1)/1 [0x1b] ( )
block_on_input:2377:blocking on input availability
so why are we getting such fast returns from poll()
despite it returning 0? and why aren't we returning this bare Escape?
so what's going on here is tied tightly in with #2646, in that we ought be doing a nonblocking (as opposed to our normal blocking) read when in the middle of an escape, yes, but we're doing constant nonblocking reads. if the first one comes back and doesn't continue our escape, we need reset midescape
. that ought fix both this and #2646.
so we do reset midescape
high in block_on_input()
, which suggests to me that the failure is in process_escapes()
-- we ought be setting midescape
high only when at the end of a full input buffer.
yeah we're missing that logic, it appears. fixing it up now and updating #2648
Launch
notcurses-input -v
. Press Escape. Output suddenly becomes pretty much continuous (there might be some small delays?) until you press a letter or something else. Pressing Escape again does not resolve the problem.