Skip to content
Myr

Fix invalid interrupt handler during execute action

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Interrupt handling during execute action was not serialized and often caused crash, failed to restore the terminal state.

authored by Junegunn Choi · committed by Junegunn Choi · parent eee45a9 · Browse files · 2 files+7 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−9 removed

  • other:+7 added−9 removed

2 files+7 added−9 removed

modified:src/curses/curses.go-9 removed
9 unmodified lines
1011import (12 "fmt"13 "os"14 "os/signal"14 "syscall"15 "time"16 "unicode/utf8"17)
251 unmodified lines
269 }270 C.noecho()271 C.raw() // stty dsusp undef272274 intChan := make(chan os.Signal, 1)275 signal.Notify(intChan, os.Interrupt, os.Kill)276 go func() {277 <-intChan278 Close()279 os.Exit(2)280 }()281273 if theme != nil {274 C.start_color()275 initPairs(theme, black)276 _color = attrColored
272 unmodified lines
modified:src/terminal.go+7 added
725 unmodified lines
726 <-timer.C727 t.reqBox.Set(reqRefresh, nil)728 }()729730 intChan := make(chan os.Signal, 1)731 signal.Notify(intChan, os.Interrupt, os.Kill)732 go func() {733 <-intChan734 t.reqBox.Set(reqQuit, nil)735 }()736737 resizeChan := make(chan os.Signal, 1)738 signal.Notify(resizeChan, syscall.SIGWINCH)739 go func() {740 for {
386 unmodified lines