refactor!: stdin handling #1596
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After fixing the handling of standard input, an issue #1568 was opened. While the previous PR (#1336) made this behavior possible, the problem is rather caused by the environments that run eza. The issue described in #1568 is happening because eza is not run interactively, but via something else: e.g. gh actions, claude, ... These environments mess with the terminal and the standard input/output/error streams. They use pseudo terminals and/or redirect input/output.
An argument was made that there is no reason for eza to allow data being piped into it. By default that is, not via an argument like
--stdin. This is a perfectly valid point, especially since a lot of other command line tools do not read from stdin by default, when data is piped into them.The following change makes eza only read from stdin, if the argument
--stdinis used.This will fix the misbehavior caused by certain environments.
BREAKING CHANGE: only read from stdin, if the argument
--stdinis used.closes #1568