mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-09 16:42:00 -07:00
Fix invalid interrupt handler during execute action
Interrupt handling during execute action was not serialized and often caused crash, failed to restore the terminal state.
This commit is contained in:
@@ -727,6 +727,13 @@ func (t *Terminal) Loop() {
|
||||
t.reqBox.Set(reqRefresh, nil)
|
||||
}()
|
||||
|
||||
intChan := make(chan os.Signal, 1)
|
||||
signal.Notify(intChan, os.Interrupt, os.Kill)
|
||||
go func() {
|
||||
<-intChan
|
||||
t.reqBox.Set(reqQuit, nil)
|
||||
}()
|
||||
|
||||
resizeChan := make(chan os.Signal, 1)
|
||||
signal.Notify(resizeChan, syscall.SIGWINCH)
|
||||
go func() {
|
||||
|
Reference in New Issue
Block a user