From bd2170a99cb996f2e00467a3416645a85eaf0549 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 26 May 2019 11:24:01 +1000 Subject: request explicit return from subprocess Previously we were recording output from subprocesses using a multiwriter and hooking that up to the cmd's stdout to write to both os.Stdout and a buffer. We would then display the output after the program finished. This worked well for commands like 'ls' but not for commands like 'vi' which expect you to be in a tty, and when you've got the cmd's stdout pointing at a multiwriter, the subprogram thinks we're not in a tty and then things like terminal corruption can happen. This was the case with neovim, and even in vim a warning was given with a pause before starting the program. Now we're chucking out the multiwriter and instead making it that you need to press enter after the program has finished to return to lazygit. This allows you to view the output of the program (e.g. if it's ls) and then decide that you want to return. It's one level of unnecessary redirection for editors like vim, but even they could potentially have output to stderr/stdout that you want to look at before returning. Please enter the commit message for your changes. Lines starting --- pkg/i18n/dutch.go | 3 +++ pkg/i18n/english.go | 3 +++ pkg/i18n/polish.go | 3 +++ 3 files changed, 9 insertions(+) (limited to 'pkg/i18n') diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index 97b49e76d..6774928fd 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -736,6 +736,9 @@ func addDutch(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "resetTo", Other: `reset to`, + }, &i18n.Message{ + ID: "pressEnterToReturn", + Other: "Press enter to return to lazygit", }, ) } diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 291f114e8..36fb3e021 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -759,6 +759,9 @@ func addEnglish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "resetTo", Other: `reset to`, + }, &i18n.Message{ + ID: "pressEnterToReturn", + Other: "Press enter to return to lazygit", }, ) } diff --git a/pkg/i18n/polish.go b/pkg/i18n/polish.go index 8229dc5df..c165ea2f0 100644 --- a/pkg/i18n/polish.go +++ b/pkg/i18n/polish.go @@ -719,6 +719,9 @@ func addPolish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "resetTo", Other: `reset to`, + }, &i18n.Message{ + ID: "pressEnterToReturn", + Other: "Press enter to return to lazygit", }, ) } -- cgit v1.2.3