mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-03 06:28:35 +08:00
Unregister interrupt signal handler when Loop exits
Registration persisted across Run() calls, so host program using fzf as library would keep trapping SIGINT/SIGTERM/SIGHUP after fzf finished
This commit is contained in:
@@ -6187,6 +6187,7 @@ func (t *Terminal) Loop() error {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
|
signal.Stop(intChan)
|
||||||
return
|
return
|
||||||
case s := <-intChan:
|
case s := <-intChan:
|
||||||
// Don't quit by SIGINT while executing because it should be for the executing command and not for fzf itself
|
// Don't quit by SIGINT while executing because it should be for the executing command and not for fzf itself
|
||||||
|
|||||||
Reference in New Issue
Block a user