mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-22 10:58:59 +00:00
Handle incomplete ESC sequence in typeahead buffer (#1350)
If an ESC char is found while processing characters, continue to check for characters. This prevents fzf from prematurely exiting. Close #1349
This commit is contained in:
parent
1c9e7b7ea6
commit
423986996a
@ -297,6 +297,7 @@ func (r *LightRenderer) getBytesInternal(buffer []byte, nonblock bool) []byte {
|
||||
}
|
||||
buffer = append(buffer, byte(c))
|
||||
|
||||
pc := c
|
||||
for {
|
||||
c, ok = r.getch(true)
|
||||
if !ok {
|
||||
@ -306,9 +307,13 @@ func (r *LightRenderer) getBytesInternal(buffer []byte, nonblock bool) []byte {
|
||||
continue
|
||||
}
|
||||
break
|
||||
} else if c == ESC && pc != c {
|
||||
retries = r.escDelay / escPollInterval
|
||||
} else {
|
||||
retries = 0
|
||||
}
|
||||
retries = 0
|
||||
buffer = append(buffer, byte(c))
|
||||
pc = c
|
||||
}
|
||||
|
||||
return buffer
|
||||
|
Loading…
Reference in New Issue
Block a user