-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Do not use 'most' PAGER, as it is not compatible with bats output #1063
Comments
I'm pretty sure this is the problem:
In case this works, we should probably make sure that others do not run into this problem and ignore if |
I think a first-time warning message would also be a good idea if we do this, otherwise people might open issues about bat not respecting the Also, should that apply to the BAT_PAGER variable as well? |
Yes, you've got it. Using |
👍 |
In preparation of fixing issue sharkdp#1063. This is a pure refactoring with no intended functional side effects.
This macro is intended to be package-internal and is not to be considered part of the public lib API. Use it in three places to reduce code duplication. However, main reason for this refactoring is to allow us to fix sharkdp#1063 without duplicating the code yet another time. The macro can also be used for the "Binary content from {} will not be printed to the terminal" message if that message starts to use eprintln! instead (if ever). To trigger/verify the changed code, the following commands can be used: cargo run -- --theme=ansi-light tests/examples/single-line.txt cargo run -- --theme=does-not-exist tests/examples/single-line.txt cargo run -- --style=grid,rule tests/examples/single-line.txt
This macro is intended to be package-internal and is not to be considered part of the public lib API. Use it in three places to reduce code duplication. However, main reason for this refactoring is to allow us to fix #1063 without duplicating the code yet another time. The macro can also be used for the "Binary content from {} will not be printed to the terminal" message if that message starts to use eprintln! instead (if ever). To trigger/verify the changed code, the following commands can be used: cargo run -- --theme=ansi-light tests/examples/single-line.txt cargo run -- --theme=does-not-exist tests/examples/single-line.txt cargo run -- --style=grid,rule tests/examples/single-line.txt
@sharkdp Seems like this issue was accidentally closed? I referenced it in my |
Fix #1063: Do not use 'more' or 'most' PAGER, as they are not compatible with bats output
Bugfix released in bat v0.18. |
I spent too much time not understanding why |
I agree, this should be documented. It would be great if you could open a new ticket such that it will not be forgotten. |
Describe the bug you encountered:
when I use bat on a single file, colors are not displayed, control sequences are diplayed instead. The bug occurs with fedora's package or when I build bat from sources. Using fish or bash does not change anything and using konsole or alacritty has the same results.
You can find a screenshot here
...
Describe what you expected to happen?
bat should display colors
...
How did you install
bat
?dnf install bat
or
cargo build
(from sources)system
$ uname -srm
Linux 5.6.18-300.fc32.x86_64 x86_64
bat
$ bat --version
bat 0.15.0
$ env
PAGER=most
bat_config
$ cat /home/daniel/.config/bat/config
bat_wrapper
No wrapper script for 'bat'.
bat_wrapper_function
No wrapper function for 'bat'.
No wrapper function for 'cat'.
tool
$ less --version
less 551 (POSIX regular expressions)
The text was updated successfully, but these errors were encountered: