m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-10 12:23:48 -05:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Massimo Mund
ead534a1be Fix modifier detection for Backspace / Ctrl-H on Windows (#4582)
Windows sends different key events and modifier combinations to theFullscreenRenderer than a tcell FullscreenRenderer on Linux (-tags tcell).
This led to Ctrl+H being misinterpreted (and therefore unbindable) on some Windows builds.

Basically reverts changes to `src/tui/tcell.go` introduced by `a0cabe0`.
2025-11-10 19:12:01 +09:00
Junegunn Choi
8a05083503 Fix reading an extra key after a terminal action
Fix #4578
2025-11-09 15:36:07 +09:00
2 changed files with 13 additions and 3 deletions

View File

@@ -496,6 +496,14 @@ const (
reqFatal
)
func isTerminalEvent(et util.EventType) bool {
switch et {
case reqClose, reqPrintQuery, reqBecome, reqQuit, reqFatal:
return true
}
return false
}
type action struct {
t actionType
a string
@@ -5528,7 +5536,7 @@ func (t *Terminal) Loop() error {
req := func(evts ...util.EventType) {
for _, event := range evts {
events = append(events, event)
if event == reqClose || event == reqQuit {
if isTerminalEvent(event) {
looping = false
}
}

View File

@@ -371,10 +371,12 @@ func (r *FullscreenRenderer) GetChar() Event {
}
case rune(tcell.KeyCtrlH):
switch {
case ctrl:
return keyfn('h')
case alt:
return Event{AltBackspace, 0, nil}
case ctrl, none, shift:
return keyfn('h')
case none, shift:
return Event{Backspace, 0, nil}
}
}
case tcell.KeyCtrlI: