mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-05 21:46:49 -04:00
If a command in a pipeline exits before reading all of its input, the command feeding it keeps running and PipeCommands never returns. The parent holds on to the read end of every pipe it wires between two commands. A pipe with a reader is a pipe worth writing to, so the command writing into it is never told that nobody is listening. Close the parent's ends once the commands are running, since each of them holds its own by then. The write ends have to go as well, or the command reading a link never reaches the end of its input. No caller reaches this today. The one chain lazygit pipes is `git stash show -p` into `git apply -R`, and apply reads its whole input before it does anything with it, so it never leaves the show writing to nobody. The chain about to be added for diff renderers is a different matter: a renderer can fail at any point of its input, and a render that is no longer wanted is stopped part way through by design. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>