Skip to content

request explicit return from subprocess#454

Merged
jesseduffield merged 1 commit into
masterfrom
437_output_from_subprocess
May 26, 2019
Merged

request explicit return from subprocess#454
jesseduffield merged 1 commit into
masterfrom
437_output_from_subprocess

Conversation

@jesseduffield

@jesseduffield jesseduffield commented May 26, 2019

Copy link
Copy Markdown
Owner

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.

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
@jesseduffield
jesseduffield force-pushed the 437_output_from_subprocess branch from 03299e2 to e0aa982 Compare May 26, 2019 01:34
@codecov-io

codecov-io commented May 26, 2019

Copy link
Copy Markdown

Codecov Report

Merging #454 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #454      +/-   ##
==========================================
+ Coverage   84.89%   84.93%   +0.03%     
==========================================
  Files          21       21              
  Lines        3542     3551       +9     
==========================================
+ Hits         3007     3016       +9     
  Misses        493      493              
  Partials       42       42
Impacted Files Coverage Δ
pkg/i18n/dutch.go 100% <100%> (ø) ⬆️
pkg/i18n/english.go 100% <100%> (ø) ⬆️
pkg/i18n/polish.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 527c025...e0aa982. Read the comment docs.

@jesseduffield
jesseduffield merged commit bd2170a into master May 26, 2019
@jesseduffield
jesseduffield deleted the 437_output_from_subprocess branch March 20, 2023 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants