handle ui suspend/resume errors

cc #592
This commit is contained in:
Gokcehan committed 2021-03-28 18:54:40 +03:00
1 parent 06bf58851b
commit 73be81595e
2 files changed
+15 -6

No files matched your search

+11 -2
View File
@@ -396,8 +396,17 @@ func (app *app) runShell(s string, args []string, prefix string) {
cmd.Stderr = os.Stderr
app.nav.previewChan <- ""
app.ui.suspend()
defer app.ui.resume()
if err := app.ui.suspend(); err != nil {
log.Printf("suspend: %s", err)
}
defer func() {
if err := app.ui.resume(); err != nil {
app.writeHistory()
os.Remove(gLogPath)
os.Exit(3)
return
}
}()
defer app.nav.renew()
err = cmd.Run()