m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 23:33:39 -05:00

[windows] Prevent fzf from consuming user input while paused

This partly fixes #4260.

fzf still can consume the first key stroke.
This commit is contained in:
Junegunn Choi
2025-03-03 14:01:53 +09:00
parent 21ce70054f
commit 8916cbc6ab
2 changed files with 39 additions and 31 deletions

View File

@@ -8,6 +8,7 @@ import (
"regexp"
"strconv"
"strings"
"sync"
"time"
"unicode/utf8"
@@ -95,7 +96,6 @@ func (r *LightRenderer) flushRaw(sequence string) {
// Light renderer
type LightRenderer struct {
closed *util.AtomicBool
theme *ColorTheme
mouse bool
forceBlack bool
@@ -120,6 +120,7 @@ type LightRenderer struct {
showCursor bool
// Windows only
mutex sync.Mutex
ttyinChannel chan byte
inHandle uintptr
outHandle uintptr
@@ -151,7 +152,6 @@ func NewLightRenderer(ttyin *os.File, theme *ColorTheme, forceBlack bool, mouse
out = os.Stderr
}
r := LightRenderer{
closed: util.NewAtomicBool(false),
theme: theme,
forceBlack: forceBlack,
mouse: mouse,
@@ -775,9 +775,8 @@ func (r *LightRenderer) Close() {
}
r.disableMouse()
r.flush()
r.closePlatform()
r.restoreTerminal()
r.closed.Set(true)
r.closePlatform()
}
func (r *LightRenderer) Top() int {