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

Add option to display file even if bat thinks it is binary #623

Closed
NightMachinery opened this issue Aug 7, 2019 · 6 comments · Fixed by #640
Closed

Add option to display file even if bat thinks it is binary #623

NightMachinery opened this issue Aug 7, 2019 · 6 comments · Fixed by #640
Labels
feature-request New feature or request good first issue Good for newcomers

Comments

@NightMachinery
Copy link

I have a file with this content:

# cat -v sth
^@this is 1.
this is 2.
this is 3.
^@hi
^@blue boy

And bat -A sth returns:
image

@sharkdp
Copy link
Owner

sharkdp commented Aug 10, 2019

We do this on purpose to prevent users from accidentally "printing" binary files to the terminal that could mess up their terminal emulator.

But adding an option to overwrite this behavior sounds very reasonable. Also, I agree that it would be great if bat -A would show the file even if it is binary.

@sharkdp sharkdp added the feature-request New feature or request label Aug 10, 2019
@sharkdp
Copy link
Owner

sharkdp commented Aug 10, 2019

see also #619

@sharkdp
Copy link
Owner

sharkdp commented Aug 15, 2019

Let's start by changing bat -A such that binary files will be displayed. Non-UTF-8 byte sequences would be replaced by a hex representation (e.g.\xFE\xEF).

@NightMachinery
Copy link
Author

NightMachinery commented Aug 16, 2019 via email

@sharkdp
Copy link
Owner

sharkdp commented Aug 31, 2019

This can now be done with bat -A, see #640 for details.

@sharkdp
Copy link
Owner

sharkdp commented Aug 31, 2019

Released in bat v0.12.

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 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants