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

Handling of binary files in interactive mode #248

Closed
sharkdp opened this issue Aug 31, 2018 · 3 comments · Fixed by #336
Closed

Handling of binary files in interactive mode #248

sharkdp opened this issue Aug 31, 2018 · 3 comments · Fixed by #336
Assignees
Labels
feature-request New feature or request

Comments

@sharkdp
Copy link
Owner

sharkdp commented Aug 31, 2018

When bat is operating in non-interactive (cat-compatibility) mode, binary files are handled fine (see #150).

However, when bat is in interactive mode (prints to a terminal), we currently just print all the content in a (lossy) UTF-8 decoded way, which is not helpful at all.

It would be great if bat could detect "binary" files (I recently wrote a small crate to do just that: https://github.com/sharkdp/content_inspector) and print a user-friendly error message / warning.

A potential nice add-on could be to print the first N bytes in hexdump style.

@sharkdp
Copy link
Owner Author

sharkdp commented Oct 17, 2018

Released in v0.8.0

@for-coursera
Copy link

A potential nice add-on could be to print the first N bytes in hexdump style.

This isn't done, right? :)

@sharkdp
Copy link
Owner Author

sharkdp commented Jan 14, 2020

No. If you think that should be added, please open a new ticket.

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants