Make `less` exit after last page or `more` interpret colors
0
votes
1
answer
83
views
In a script, I’m doing a
git diff
that I want to quickly page through. When I’m finished, the pager will exit and the script will continue.
more
is great for the task, because I can space through it and it will exit at the end of the file. Unfortunately, instead of the diff colours it shows the control characters.
less
shows the colours just fine, but when reaching the end of the file it does not exit, q is needed.
How do I get both colour support and exiting on last space? No external tools can be added, only what comes with a default macOS installation.
Asked by user137369
(584 rep)
Nov 18, 2021, 11:22 PM
Last activity: Nov 20, 2021, 10:56 PM
Last activity: Nov 20, 2021, 10:56 PM