Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix paging not happening when stdout is interactive but stdin is not #2574

Merged
merged 1 commit into from
May 22, 2023

Conversation

Nigecat
Copy link
Contributor

@Nigecat Nigecat commented May 22, 2023

This seems to have been introduced in 57cc0d8 since the condition !atty::is(Stream::Stdin) was inverted to std::io::stdin().is_terminal(). This seems to be a mistake since the comment says

// If we are reading from stdin, only enable paging if we write to an
// interactive terminal and if we do not *read* from an interactive
// terminal.

but the current code enables paging if stdin is interactive.

This PR just flips the condition back to how it was to restore the original behavior.
No changelog update as there hasn't been a release since the regression was introduced.

Fixes #2572

@Enselic
Copy link
Collaborator

Enselic commented May 22, 2023

Oops! Thank you 🙏

@Enselic Enselic merged commit 149dec6 into sharkdp:master May 22, 2023
18 checks passed
@jamesodhunt
Copy link

Thanks @Nigecat ! 😄

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.

regression: bat fails to page - will not read from stdin if no file (or -) specified
3 participants