Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- `core.watchman.register_snapshot_trigger`
- `diff.format`

* `jj` now ignores `$PAGER` set in the environment and uses `less -FRX` on most
platforms (`:builtin` on Windows). To override the default pager, set
`ui.pager`, see [the docs](docs/config.md#pager) for more information. If you
have a `$PAGER` that you'd like `jj` to use, you can run `jj config set --user
ui.pager "$PAGER"` once to save the current value of `$PAGER` to `jj`'s
configuration.

### Deprecations

* `jj bisect run --command <cmd>` is deprecated in favor of
Expand Down Expand Up @@ -88,6 +95,9 @@ edits the change twice in some cases.
* Fixed parsing of `files(expr)` revset expression including parentheses.
[#7747](https://github.com/jj-vcs/jj/issues/7747)

* Fixed `PAGER` being set in the environment causing ANSI escape sequences to be
displayed to the terminal. [#3502](https://github.com/jj-vcs/jj/issues/3502)

## [0.34.0] - 2025-10-01

### Release highlights
Expand Down
5 changes: 2 additions & 3 deletions cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,14 +670,13 @@ fn env_base_layer() -> ConfigLayer {
// should override $NO_COLOR." https://no-color.org/
layer.set_value("ui.color", "never").unwrap();
}
if let Ok(value) = env::var("PAGER") {
layer.set_value("ui.pager", value).unwrap();
}
Comment on lines -673 to -675
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think we can sensibly deprecate this in 3 releases, so currently adding a warning here may be the option before straight up removing it. I'm up making the removal processes shorter if you deem this to hard for Google.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we need a deprecation process and multiple releases? I consider the current behavior to be a bug. The only ones who would benefit from a deprecation warning would be those that intentionally set $PAGER to some non-less value. I don't have any actual metrics, but this is likely relatively small (vanishingly small amongst the general population, but only 'relatively' small amongst early jj adopters, I'm assuming).

Contrast with the number of users broken by this bug, whose first experience with jj is that it's completely unusable and they start off with a very negative experience. We can override this at Google and never show the deprecation warning at all, so there's no pressure to shorten this time period from us. But as jj usage is growing outside of Google, I think we should have the out-of-the-box experience be the best it can be, even if it means a sudden change in behavior (a slight regression) for a small subset of current users.

(Also, I'm just not sure how to even implement the deprecation warning: we can't check here because we don't know what the value of ui.pager is going to be from the user's config; we can't check that $PAGER is set when using ui.pager, because if users follow the advice to preserve $PAGER, they'll set ui.pager to be $PAGER... what we'd need is a check when loading the user configs that ui.pager ISN'T set in that config layer but IS set in $PAGER; I don't know if we have anything like that kind of logic already)

if let Ok(value) = env::var("VISUAL") {
layer.set_value("ui.editor", value).unwrap();
} else if let Ok(value) = env::var("EDITOR") {
layer.set_value("ui.editor", value).unwrap();
}
// Intentionally NOT respecting $PAGER here as it's very likely to create a bad
// out-of-the-box experience for users, see http://github.com/jj-vcs/jj/issues/3502.
layer
}

Expand Down
22 changes: 8 additions & 14 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,20 +711,14 @@ show-cryptographic-signatures = true

## Pager

The default pager is can be set via `ui.pager` or the `PAGER` environment
variable. The priority is as follows (environment variables are marked with
a `$`):

`ui.pager` > `$PAGER`

`less -FRX` is the default pager in the absence of any other setting, except
on Windows where it is `:builtin`.

The special value `:builtin` enables usage of the [integrated
pager](#builtin-pager).

If you are using a standard Linux distro, your system likely already has
`$PAGER` set and that will be preferred over the built-in. To use the built-in:
By default, jj will paginate output that would scroll off the screen. It does
this by passing output through `less -FRX` on most platforms (on Windows it uses
the pager that is built-in to jj).

Which pager to use can be customized by setting `ui.pager`. When choosing a
pager, ensure that it either supports color codes or that you disable color (see
[Colorizing output](#colorizing-output)). To use the [integrated
pager](#builtin-pager), set it to the special value `:builtin`:

```shell
jj config set --user ui.pager :builtin
Expand Down