What is it? It says it is a cat clone, but what is cat?
cat is a classic unix program that outputs the contents of one or more files to stdout. It's short for concatenate
Bat v0.26.0
11–20 of 78 posts
Re: Bat v0.26.0
#12What is it? It says it is a cat clone, but what is cat?
Bat is a file viewer that supports syntax highlighting and reads git status to also annotate added/deleted/changed lines. The classic file viewer for a terminal is cat (or less).
Bat is a file viewer in every sense. I have concatenated multiple files using bat. It does come in handy sometimes. But even the concatenated output is designed to be a visual aid, not the traditional concatenation that cat does.
Re: Bat v0.26.0
#13Re: Bat v0.26.0
#14When I saw this, I was hoping that [The Bat!]( https://www.ritlabs.com/en/products/thebat/ ) had been released as FOSS. This is still pretty cool.
Re: Bat v0.26.0
#15Earlier quoted context omitted.
Bat is a file viewer that supports syntax highlighting and reads git status to also annotate added/deleted/changed lines. The classic file viewer for a terminal is cat (or less).
Just a nitpick. The real use of cat is to concatenate two or more files and dump the result in its stdout. But people use it more like file viewer these days. Bat is a file viewer in every sense. I have concatenated multiple files using bat. It does come in handy sometimes. But even the concatenated output is designed to be a visual aid, not the traditional concatenation that cat does.
Re: Bat v0.26.0
#16Re: Bat v0.26.0
#17> Traditional pagers like more or less weren't made for integrating into other applications. They were meant to be standalone binaries that are executed directly by users. However most applications don't adhere to this and exploit these pagers' functionality by calling them as external programs and passing the data through the standard input.
Do people widely agree with this? That sounds less like 'exploitation' to me and more like 'the way Unix works'.
> This method worked for Unix and other Unix-like OSs like Linux and MacOS because they already came with any of these pagers installed. But it wasn't this easy on Windows; it required shipping the pager binary along with the applications. Since these programs were originally designed for Unix and Unix-like OSs, distributing these binaries meant shipping an entire environment like MinGW or Cygwin so that these can run properly on Windows.
So, to support Windows, we have to:
- Abandon (maybe bypass) the core Unix principle of composing programs to carry out more complex tasks - Reimplement a pager library in every language
Is that really the best approach? Even if so, I would have thought a minimal pager would be best, but the feature list of this pager library is fairly extensive: https://github.com/AMythicDev/minus?tab=readme-ov-file#featu...
Re: Bat v0.26.0
#18Re: Bat v0.26.0
#19Earlier quoted context omitted.
Bat is a file viewer that supports syntax highlighting and reads git status to also annotate added/deleted/changed lines. The classic file viewer for a terminal is cat (or less).
Just a nitpick. The real use of cat is to concatenate two or more files and dump the result in its stdout. But people use it more like file viewer these days. Bat is a file viewer in every sense. I have concatenated multiple files using bat. It does come in handy sometimes. But even the concatenated output is designed to be a visual aid, not the traditional concatenation that cat does.
Re: Bat v0.26.0
#20The `--pager=builtin` change is interesting; first time I've heard of minus. > Traditional pagers like more or less weren't made for integrating into other applications. They were meant to be standalone binaries that are executed directly by users. However most applications don't adhere to this and exploit these pagers' functionality by calling them as external programs and passing the data through the standard input…