-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Show header/grid even for empty files? #563
Comments
Thank you for the feedback. What exactly do you expect?
PS: When combining
|
Wow, that's not what mine does:
Any idea why mine would be different?
Thanks, I saw that, but it uses a randomized order like you'd get with $ for i in a b c d; do echo $i > $i.txt; done
$ fd
a.txt
b.txt
c.txt
d.txt
$ fd -x bat
c
b
d
a
$ fd -X bat -p
c
b
a
d
$ fd | xargs bat -p
a
b
c
d
$ fd --version
fd 7.3.0 |
Sweet! Glad to hear. That's the best kind of problem (one that's already fixed). One thing I noticed, in your version above, an empty file looks like: ───────┬─────────────────────────────────────────────────────────
│ File: empty
───────┼─────────────────────────────────────────────────────────
───────┴───────────────────────────────────────────────────────── In #500 you show the empty file display like this:
Just my 2¢: I like the second variation better. It cuts down on clutter + needless separators for empty files. One small suggestion: just like you have a header for a few things, like $ bat utf16.txt
───────┬────────────────────────────────────────
│ File: utf16.txt <UTF-16LE>
───────┼────────────────────────────────────────
1 │ <U+FEFF>This is text in UTF-16
───────┴──────────────────────────────────────── It might be nice to add something there like Lastly, any comment on that |
Note that due to parallelism,
Unfortunately, execution mode ( To be honest, I'm a little surprised myself that batch execution mode ( But in general, you can never rely on any (output or execution) order when using |
Oh, you are absolutely right. I missed that in the linked ticket. We should try to get the old behavior back (second variation). I also like that better.
👍 |
Yeah your |
Fixed in v0.11.0. |
Because
bat
helpfully prints out a header for every file, I never again have to do things like:when I
cat
multiple files to know what text goes with what file. Now I can straightfd ... | xargs bat
, and this makes me happy.There's one difference though from that shell loop above: you don't get any output for empty files. I get how
bat
evolved that way; cat gives no output for empty files sobat
does the same. Withbat
, the chrome could be useful by itself even for empty files. It would be nice if there was a flag to enable printing empty files.The text was updated successfully, but these errors were encountered: