Skip to content
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

feat: use a pager for all large terminal output, not just for help #2268

Merged
merged 11 commits into from
Oct 20, 2024

Conversation

simonmichael
Copy link
Owner

@simonmichael simonmichael commented Oct 18, 2024

This is an impactful change, and I value the CLI and easy scriptability. But it has been working well for help output, and I for one am ready for it. Feedback, testing and problem reports welcome.

Doc:

Paging

On unix-like systems, when displaying large output in the terminal,
hledger tries to use a pager when appropriate:
the one specified by the PAGER environment variable,
otherwise less if available, otherwise more if available.
The pager shows one page of text at a time, and lets you scroll around to see more.
While it is active, usually SPACE shows the next page, q quits, and ? shows more features.

The pager is expected to display ANSI color and text styling if possible.
hledger adds R to the LESS and MORE environment variables to enable this
in less (and in its more compatibility mode).
If you use a different pager, you might need to configure it similarly, to avoid seeing junk on screen.
Or you can set the NO_COLOR environment variable described below.

--color now also works in a config file, like --pager, except for two
cases: it does not affect colouring of debug output, or the colouring
helpers used in the check recentassertions error message.
@simonmichael simonmichael merged commit b940254 into master Oct 20, 2024
1 check passed
@simonmichael simonmichael deleted the pager-for-all branch October 20, 2024 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. impact5 Affects most or all users. platform:freebsd platform:linux platform:mac
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant