From 86527072993544126c8a9572b33d1bc3e4da9e1e Mon Sep 17 00:00:00 2001 From: Joe Lim <50560759+joelim-work@users.noreply.github.com> Date: Tue, 21 Mar 2023 03:59:39 +1100 Subject: [PATCH] Avoid refreshing previews for async shell commands (#1164) --- app.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index 24e3ae51..8f7d94c6 100644 --- a/app.go +++ b/app.go @@ -563,7 +563,11 @@ func (app *app) runShell(s string, args []string, prefix string) cleanFunc { anyKey() } - app.ui.loadFile(app, true) + // Asynchronous shell invocations return immediately without waiting for the + // command to finish, so there is no point refreshing the preview if nothing + // has changed yet. + volatile := prefix != "&" + app.ui.loadFile(app, volatile) switch prefix { case "%":