-
Notifications
You must be signed in to change notification settings - Fork 373
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
cli: Provide better flags for the "less" pager than default #2928
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but it's probably good to give others a day or something to spot any problems we've missed.
I think this should be documented in https://martinvonz.github.io/jj/v0.13.0/config/#pager. The simplest thing would be to change a sentence to say:
You could also add footnote about how to disable this behavior. If it's a chore, this doesn't have to be a blocker; we can do it in a separate PR. Overall, I think this idea could work; we'll see if anybody gets annoyed by it. I can imagine somebody not liking One thing I like about this implementation is that it won't affect people who set PAGER to |
I don't like fwiw, both git and hg respect |
I almost feel like the actual right answer is to have a built-in pager with the defaults |
We discussed this a few times, but unfortunately didn't create a bug for it. https://github.com/markbt/streampager would be a nice option, but it seems no longer maintained. It's what Sapling uses. I think I found a few more Rust pagers, but they seemed very new. There are some nice Golang pagers ( |
as a last resort, if you really want to distribute jj as a single static binary, you could embed the entire Go binary as static data in the rust binary, and then unpack it at runtime into a binary in the same directory (or run it in-memory with https://docs.rs/memfd-exec). but i know that's kinda hacky. |
// If 'less' is the value of PAGER, do not override the pager. | ||
// Many systems ship with "R" as the only setting in $LESS, which provides | ||
// a less than ideal experience for 'less' with jj, since they won't see the | ||
// log history persist on the screen. While slightly inconsistent to ignore | ||
// that setting, it should provide a better "out-of-box experience". If a user | ||
// truly wants to change the values that are passed to "less", they can set that | ||
// in the ui.pager jj config. | ||
if value != "less" { | ||
builder = builder.set_override("ui.pager", value).unwrap(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this change should be mentioned in the changelog?
As I commented on the Issue, if you are interesting all of what git does, see https://github.com/epage/git-dive/blob/main/src/git_pager.rs As for built-in pagers, one I hadn't seen mentioned is https://crates.io/crates/minus. |
Right, that's a good one! One annoying limitation is that |
Closing in favor of #3024 and anything else that will come from that direction of a solution instead of special casing |
Checklist
If applicable:
CHANGELOG.md