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

All styles except full & header silently swallow binary data #466

Closed
lewisthompson opened this issue Jan 11, 2019 · 3 comments
Closed

All styles except full & header silently swallow binary data #466

lewisthompson opened this issue Jan 11, 2019 · 3 comments
Labels
feature-request New feature or request help wanted Extra attention is needed

Comments

@lewisthompson
Copy link

lewisthompson commented Jan 11, 2019

% bat --version
bat 0.9.0
% bat --style=plain .DS_Store
% bat --style=changes .DS_Store
% bat --style=grid .DS_Store
% bat --style=numbers .DS_Store
% bat --style=header .DS_Store
File: .DS_Store   <BINARY>

--style=full omitted as it's somewhat bulky.

Personally I am using bat indirectly through commands I'm already familiar with:

% which cat
cat: aliased to bat --plain --paging=never
% which more
more: aliased to bat --plain --pager="less --no-init --quit-at-eof"

So my preference would be to just spew binary data and junk to my terminal. However, in other modes any sort of indication that the output is being omitted would be helpful.

I believe this is related to #248 and the issue is present in master.

@sharkdp
Copy link
Owner

sharkdp commented Jan 13, 2019

Thank you very much for the feedback.

However, in other modes any sort of indication that the output is being omitted would be helpful.

We should probably fix this, yes. I'd say we print a warning to stderr ("Omitting binary file ...") if the --style does not include a header line.

my preference would be to just spew binary data and junk to my terminal

We should probably add a flag to allow for this. Currently there is no way to force bat to print files which it detected as "binary" (see this article for more information on how bat does this).

@sharkdp sharkdp added feature-request New feature or request help wanted Extra attention is needed labels Jan 13, 2019
@sharkdp
Copy link
Owner

sharkdp commented May 14, 2019

Closed via #550

See also #530

@sharkdp sharkdp closed this as completed May 14, 2019
@sharkdp
Copy link
Owner

sharkdp commented May 15, 2019

Fixed in v0.11.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants