-
-
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
Previewing binary files? #800
Comments
Related to: #619 |
Not really. |
The initial issue of using |
It was suggested here #619 (comment) that having a I would also like this to be implemented, because I sometimes use
So in that case, |
I'd rather not implement this. It's easy to write a wrapper script that would do this. |
If the exit code would be different from 0. Right now it is just 0 which makes writting a generic wrapper harder. |
When reading data from stdin it's definitely not trivial. You'd have to :
I have written such script, and it is near 100 lines of Python, and very far from handling all corner cases. It's too bad you don't want to consider a solution for this as you are in a special position to do so as the author of both |
For catting a file it is easier. You can extract the filename, check with |
I have written a wrapper script to preview almost anything using bat, ls and some extra tools - hexyl is not integrated yet, but that sounds great, too. I am considering to publish it at some point as I am dazzled to not have found anything like that so far. |
I also wrote rsop as general wrapper for terminal tools like bat and hexyl. |
@desbma Wow I had been searching for such a tool for so long until building it myself, this looks fantastic :) and maybe I can contribute something to it as well |
Yeah I wrote it for myself with this issue in mind, but now it can do much more than text/binary dispatch because it can sniff MIME type, including when piped, so you can preview images, pcap files, whatever. You should be able to customize it for your needs with the config file, but if not, contribution welcome! |
Some option allowing to get a glimpse of binary files would be great. May be some first N bytes in
hexdump
style as mentioned here, may be just a few lines of thecat
-like output.What do you think?
The text was updated successfully, but these errors were encountered: