Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
Enselic merged 1 commit into
sharkdp:mastersharkdp/bat:masterfrom
Nigecat:fix-pagingNigecat/bat:fix-pagingCopy head branch name to clipboard
May 22, 2023
Merged

Fix paging not happening when stdout is interactive but stdin is not#2574
Enselic merged 1 commit into
sharkdp:mastersharkdp/bat:masterfrom
Nigecat:fix-pagingNigecat/bat:fix-pagingCopy head branch name to clipboard

Conversation

@Nigecat

@Nigecat Nigecat commented May 22, 2023

Copy link
Copy Markdown
Contributor

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

Enselic commented May 22, 2023

Copy link
Copy Markdown
Collaborator

Oops! Thank you 🙏

@Enselic
Enselic merged commit 149dec6 into sharkdp:master May 22, 2023
@jamesodhunt

Copy link
Copy Markdown

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.