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

bat refuses to page content #2570

Closed
mataha opened this issue May 17, 2023 · 7 comments · Fixed by #2651
Closed

bat refuses to page content #2570

mataha opened this issue May 17, 2023 · 7 comments · Fixed by #2651
Labels
bug Something isn't working

Comments

@mataha
Copy link
Contributor

mataha commented May 17, 2023

What steps will reproduce the bug?

bat some-long-test-file.txt --pager more --paging always

What happens?

Contents of the file are dumped to the terminal all at once.

What did you expect to happen instead?

Paging with more.

How did you install bat?

Cargo.


bat version and environment

Software version

bat 0.23.0

Operating system

Windows 6.2.9200

Command-line

bat test.cmd --pager more --paging always --diagnostic

Environment variables

SHELL=<not set>
PAGER=<not set>
LESS=<not set>
LANG=<not set>
LC_ALL=<not set>
BAT_PAGER=more
BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
XDG_CONFIG_HOME=<not set>
XDG_CACHE_HOME=<not set>
COLORTERM=<not set>
NO_COLOR=<not set>
MANPAGER=<not set>

System Config file

Could not read contents of 'C:\ProgramData\bat\config': System nie może odnaleźć określonej ścieżki. (os error 3).

Config file

Could not read contents of 'C:\Users\Mataha\AppData\Roaming\bat\config': System nie może odnaleźć określonej ścieżki. (os error 3).

Custom assets metadata

Could not read contents of 'C:\Users\Mataha\AppData\Local\bat\metadata.yaml': System nie może odnaleźć określonej ścieżki. (os error 3).

Custom assets

'C:\Users\Mataha\AppData\Local\bat' not found

Compile time information

  • Profile: release
  • Target triple: x86_64-pc-windows-msvc
  • Family: windows
  • OS: windows
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2
  • Host: x86_64-pc-windows-msvc
@mataha mataha added the bug Something isn't working label May 17, 2023
@keith-hall
Copy link
Collaborator

#1666

@mataha
Copy link
Contributor Author

mataha commented May 17, 2023

#1666

Not applicable; --pager more or set BAT_PAGER=more should force it as override happens only when a problematic pager comes from the PAGER environment variable: https://github.com/sharkdp/bat/blob/master/src/pager.rs#L109-L120

@sharkdp
Copy link
Owner

sharkdp commented May 25, 2023

Could this be a duplicate of #2572? (or the other way around)

@mataha
Copy link
Contributor Author

mataha commented May 27, 2023

@keith-hall
Copy link
Collaborator

Windows 6.2.9200

this is Windows Server 2012, right? (https://www.gaijin.at/en/infos/windows-version-numbers)
what terminal emulation program are you using? Not sure what difference it would make, but I know later versions of Windows have whole new conhost.exe and if you are able to try something different (even MSYS2 mintty) it could be helpful to rule stuff out.

@mataha
Copy link
Contributor Author

mataha commented May 29, 2023

Wow, that slipped past my attention - I didn't notice it at all. I'm on Windows 10 using conhost.exe:

$ ver
Microsoft Windows [Version 10.0.19044.2965]

...why does bat think it's Windows Server 2012? Maybe that's what I should investigate first? EDIT: that seems like an unrelated issue.

@mataha
Copy link
Contributor Author

mataha commented May 30, 2023

I've finally managed to track it down. It's... hilarious, to say the least. See BurntSushi/ripgrep#2523...

Enselic pushed a commit that referenced this issue Sep 1, 2023
The intention is to take advantage of `std::io::IsTerminal` that landed
in 1.70.0, both in `bat` and its dependencies (`clap`, `grep-cli`).

This will fix #2570 as well - `grep-cli` 0.1.9 has a patch for that.

Signed-off-by: mataha <mataha@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants