-
-
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
cat -s clone #762
Comments
While I can see that as a convenient option, it also goes against the philosophy of "do one thing, and do it well." Using an external command and a pipe would probably be more flexible and configurable. If you care about preserving the line numbers but not displaying the consecutive blank lines though, we would have to implement that inside bat like you suggested. |
I'm interested in simply removing consecutive blank lines, like what cat -s does.
But as you can see this adds a lot of text (as well as some cognitive load) compared to -s. The -s option is pretty handy when the input contains many meaningless empty lines and the user wants to have a quick compact preview. While this is a trivial functionality, it could also make bat a more complete replacement of (GNU) cat. |
Since #766 has been merged, the following would also work: bat --plain --color=always … | cat -s |
Closing this for now, as there is no plan to implement this and there is a reasonable alternative. |
I would also like to see this implemented. It falls under "do one thing and do one thing well" if you want to cat a file for inspection (what else is cat for?) that has a ton of newlines. Such newlines can push content that I want to see off the screen requiring scrolling to view the contents of the file. Adding this feature makes it do the job BETTER. The only reasonable alternative now is to fall back on |
see #1441 |
I do need this option |
The
-s
/--squeeze-blank
option of cat can "squeeze" consecutive blank lines into one.With
cat -s
, the above text will become:It would be convenient if bat provides the same functionality.
The text was updated successfully, but these errors were encountered: