Allow aborting while opening a file with backup

Also fixes an issue where the abort prompt consumes interrupt signals.

Fixes #2151
This commit is contained in:
Zachary Yedidia
2021-08-02 21:05:22 -04:00
parent 33e064b3b9
commit c315a91fc6
3 changed files with 23 additions and 14 deletions

View File

@@ -274,12 +274,6 @@ func main() {
fmt.Println("Fatal: Micro could not initialize a Screen.")
os.Exit(1)
}
sigterm = make(chan os.Signal, 1)
sighup = make(chan os.Signal, 1)
signal.Notify(sigterm, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
signal.Notify(sighup, syscall.SIGHUP)
m := clipboard.SetMethod(config.GetGlobalOption("clipboard").(string))
clipErr := clipboard.Initialize(m)
@@ -353,6 +347,11 @@ func main() {
screen.Events = make(chan tcell.Event)
sigterm = make(chan os.Signal, 1)
sighup = make(chan os.Signal, 1)
signal.Notify(sigterm, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
signal.Notify(sighup, syscall.SIGHUP)
// Here is the event loop which runs in a separate thread
go func() {
for {