-
-
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
Add ability to enable --show-all output when output is redirected #1061
Comments
Hm, or maybe I don't :) GNU cat allows
|
Thank you for the feedback and for reporting this! I would actually consider this a bug. What you can do for now is to use |
Fixed in v0.16.0. |
I didn't find a way to enable --show-all only if the output is interactive (stdout is a tty). So here is a function cat -d "Print a file nicely"
if isatty stdout
bat --show-all $argv
else
set -l catBin $(type --no-functions --path cat)
$catBin $argv
end
end One can use function cat -d "Print a file nicely"
if isatty stdout
bat --show-all $argv
else
bat --style=plain --pager=never $argv
end
end Sorry for the noise. |
Hi, I occasionally find myself wanting to capture the (very nice and useful)
--show-all
output. For example, in order to compute a diff on the--show-all
output itself. Currently, the only way I know how to do this is to print the--show-all
output to the screen, select it with a mouse, and copy it into a text file.I understand the reasonIf not by default then perhaps what I'm requesting could be something likebat
must, by default, only enable-A
if stdout is attached to an interactive terminal.Thanks for all the work on bat!
The text was updated successfully, but these errors were encountered: