Run on-quit when terminal closes (#1681)
This commit is contained in:
1 parent
63815aaa75
commit
ce12116418
2 files changed
+8
-4
No files matched your search
@@ -64,6 +64,8 @@ func newApp(ui *ui, nav *nav) *app {
|
||||
}
|
||||
|
||||
func (app *app) quit() {
|
||||
onQuit(app)
|
||||
|
||||
if gOpts.history {
|
||||
if err := app.writeHistory(); err != nil {
|
||||
log.Printf("writing history file: %s", err)
|
||||
@@ -320,10 +322,6 @@ func (app *app) loop() {
|
||||
continue
|
||||
}
|
||||
|
||||
if cmd, ok := gOpts.cmds["on-quit"]; ok {
|
||||
cmd.eval(app, nil)
|
||||
}
|
||||
|
||||
app.quit()
|
||||
|
||||
app.nav.previewChan <- ""
|
||||
|
||||
Reference in new issue
Block a user