Skip to content

run less more robustly; don't add --quit-at-eof#2546

Merged
simonmichael merged 3 commits intomasterfrom
sm-less
Feb 1, 2026
Merged

run less more robustly; don't add --quit-at-eof#2546
simonmichael merged 3 commits intomasterfrom
sm-less

Conversation

@simonmichael
Copy link
Owner

@simonmichael simonmichael commented Jan 30, 2026

This adds more robust handling of various less and pager failure mode. Generally when anything goes wrong, it should always fall back to printing the output unpaged.

Based on feedback from chat, I have removed --quit-at-eof from the options that hledger adds to LESS when using less as pager. It meant that when you scrolled to the bottom of long output, you would often end up exiting less by accident, so you couldn't scroll back up. Now when less is invoked (because output is longer than the window), you'll always see its end of output indicator at the bottom and you'll always have to press q to exit.

Of course you can override this default by setting your preferred less options in HLEDGER_LESS (or by setting PAGER to something else or by using --pager=no).

Related: #2544

@simonmichael
Copy link
Owner Author

This is in today's https://github.com/simonmichael/hledger/releases/tag/testlatest binaries, all testing including on old environments is welcome.

@simonmichael simonmichael added A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. A-WISH Some kind of improvement request or proposal. cli Command line parsing, options, arguments and suchlike. and removed A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. labels Jan 30, 2026
@simonmichael simonmichael merged commit 0761551 into master Feb 1, 2026
1 check passed
@simonmichael simonmichael deleted the sm-less branch February 1, 2026 03:00
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 or proposal. cli Command line parsing, options, arguments and suchlike.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant