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

Fix reading an extra key after a terminal action

Fix #4578
This commit is contained in:
Junegunn Choi
2025-11-09 15:35:14 +09:00
parent e659b46ff5
commit 8a05083503

View File

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