Script that asks to write to terminal when using Bat in --paging=always mode #3898
RedSnt
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
So I prefer always having paging on when using Bat and I found out that one can't actually print to the terminal from inside Less because of how Less works, and while Bat does have the option of only printing to terminal if the output is less than a single page, I prefer this method of just being asked after exiting Less:
I've saved it as
~/.local/bin/bat_choice.shon my system with~/.local/binof course being in $PATHPerhaps over-engineered what with the line erasure thing which is like half the script, I guess one can remove that if it isn't a bother.
Usage could be
bat_choice.sh /etc/os-releaseorcat /etc/os-release | bat_choice.shAnywhoodle, just a little saturday afternoon Bat related project I noodled with that someone might find useful :)
All reactions