diff options
author | Joe Lim <50560759+joelim-work@users.noreply.github.com> | 2024-11-17 23:10:20 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-17 23:10:20 +1100 |
commit | 68a29c92848397e642e060a83f8a1bd7bd979af2 (patch) | |
tree | 22e1391e76b8066acb725dce7d96f0005dc64d45 | |
parent | f0dddccb04f9e2f99146a6832ee7798a51cd6256 (diff) |
-rw-r--r-- | app.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -35,6 +35,7 @@ type app struct { menuCompInd int selectionOut []string watch *watch + quitting bool } func newApp(ui *ui, nav *nav) *app { @@ -66,6 +67,14 @@ func newApp(ui *ui, nav *nav) *app { } func (app *app) quit() { + // Using synchronous shell commands for `on-quit` can cause this to be + // called again, so a guard variable is introduced here to prevent an + // infinite loop. + if app.quitting { + return + } + app.quitting = true + onQuit(app) if gOpts.history { |