mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-18 02:55:11 +00:00
parent
4accc69022
commit
d206949f62
@ -295,13 +295,24 @@ func getch(nonblock bool) int {
|
||||
|
||||
func GetBytes() []byte {
|
||||
c := getch(false)
|
||||
retries := 0
|
||||
if c == 27 {
|
||||
// Wait for additional keys after ESC for 100ms (10 * 10ms)
|
||||
retries = 10
|
||||
}
|
||||
_buf = append(_buf, byte(c))
|
||||
|
||||
for {
|
||||
c = getch(true)
|
||||
if c == -1 {
|
||||
if retries > 0 {
|
||||
retries--
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
retries = 0
|
||||
_buf = append(_buf, byte(c))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user