diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-03-03 14:01:53 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-03-03 14:04:16 +0900 |
| commit | 8916cbc6ab198abdfa1e5cb24602c13730cb1987 (patch) | |
| tree | af47becaf47d378971471725a95f92eced5582d2 /src/tui/light.go | |
| parent | 21ce70054f4f65efafcd056d1101f1040187c8d4 (diff) | |
| download | fzf-8916cbc6ab198abdfa1e5cb24602c13730cb1987.tar.gz | |
[windows] Prevent fzf from consuming user input while paused
This partly fixes #4260.
fzf still can consume the first key stroke.
Diffstat (limited to 'src/tui/light.go')
| -rw-r--r-- | src/tui/light.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/tui/light.go b/src/tui/light.go index acd07ab7..3b940646 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -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 { |
