summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-03-22 08:13:15 +0100
committerGitHub <noreply@github.com>2024-03-22 08:13:15 +0100
commit251bfb6a24f6f70d5db0c443b1d4a92a08e6826c (patch)
treee3966ff58c6140b79d003dbbf89167b9f8fa6b39
parentfadc2893d21c798e2b64b7f7929927347cf242dd (diff)
parent377eced31adb9aa636896fea60060f9f8a9de910 (diff)
Always prompt to return from subprocess if there was an error (#3410)
- **PR Description** When lazygit suspends itself to the background to run an external command, and the command returns a non-zero exit code, always show the prompt for pressing enter to return to lazygit, even if the `promptToReturnFromSubprocess` is set to `false`. The rationale is that if the process returned an error, it likely also printed some error message to the console that users will always want to read. I was considering turning the `promptToReturnFromSubprocess` config into an enum with values `never`, `onlyOnError`, `always`, but then I felt that `onlyOnError` is really the only sensible choice for people who have it set to `false` now, so I just hard-coded that.
-rw-r--r--pkg/gui/gui.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index ba759505a..9de9ca2bc 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -824,7 +824,7 @@ func (gui *Gui) runSubprocess(cmdObj oscommands.ICmdObj) error { //nolint:unpara
subprocess.Stderr = io.Discard
subprocess.Stdin = nil
- if gui.Config.GetUserConfig().PromptToReturnFromSubprocess {
+ if gui.integrationTest == nil && (gui.Config.GetUserConfig().PromptToReturnFromSubprocess || err != nil) {
fmt.Fprintf(os.Stdout, "\n%s", style.FgGreen.Sprint(gui.Tr.PressEnterToReturn))
// scan to buffer to prevent run unintentional operations when TUI resumes.