jj icon indicating copy to clipboard operation
jj copied to clipboard

FR: Pager: better match `git` behavior

Open colemickens opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. I want to be able to run jj log, somehow exit, and see the output in my terminal to type my next command, probably reading some change id from the output, etc.

However, git chooses to skip the pager entirely for very short outputs, or in cases where git does use a pager, exiting the pager leaves the output left visible when jj/pager exits.

Describe the solution you'd like I don't know enough about how pagers work, how git uses its, which ones git/jj default to, etc, to suggest the right solution.

Describe alternatives you've considered Using a different PAGER, but I'm not sure that addresses the core issue, and I think a different solution by default might be appropriate anyway.

Additional context https://asciinema.org/a/tIdymnAYdgCOg5A6TBQTTWtrE

colemickens avatar Feb 07 '24 04:02 colemickens

https://github.com/martinvonz/jj/pull/2928 will hopefully fix this soon. There are many details in the PR and the issue it links to.

ilyagr avatar Feb 07 '24 04:02 ilyagr

If its of use, I dug into how git interacts with pagers and consolidated it down to a single rust file: https://github.com/epage/git-dive/blob/main/src/git_pager.rs

epage avatar Feb 11 '24 01:02 epage