mirror of
https://github.com/junegunn/fzf
synced 2024-11-10 13:10:44 +00:00
Fix panic on unexpected escape sequences
This commit is contained in:
parent
5cae8ea733
commit
ec75d16ea8
@ -467,7 +467,7 @@ func (r *LightRenderer) escSequence(sz *int) Event {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Bracketed paste mode: \e[200~ ... \e[201~
|
// Bracketed paste mode: \e[200~ ... \e[201~
|
||||||
if r.buffer[3] == '0' && (r.buffer[4] == '0' || r.buffer[4] == '1') && r.buffer[5] == '~' {
|
if len(r.buffer) > 5 && r.buffer[3] == '0' && (r.buffer[4] == '0' || r.buffer[4] == '1') && r.buffer[5] == '~' {
|
||||||
// Immediately discard the sequence from the buffer and reread input
|
// Immediately discard the sequence from the buffer and reread input
|
||||||
r.buffer = r.buffer[6:]
|
r.buffer = r.buffer[6:]
|
||||||
*sz = 0
|
*sz = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user