Skip to content

Commit

Permalink
cli: Provide better flags for the "less" pager than default
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrittain committed Feb 3, 2024
1 parent ae3404c commit cb23225
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,16 @@ fn env_base() -> config::Config {
builder = builder.set_override("ui.color", "never").unwrap();
}
if let Ok(value) = env::var("PAGER") {
builder = builder.set_override("ui.pager", value).unwrap();
// 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();
}
}
if let Ok(value) = env::var("VISUAL") {
builder = builder.set_override("ui.editor", value).unwrap();
Expand Down

0 comments on commit cb23225

Please sign in to comment.