ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/cli
Martin von Zweigbergk aa675b9cde
config: set $LESS and $LESSCHARSET even if $PAGER is set
Our current default for `ui.pager` is this:

```toml
ui.pager = { command = ["less"], env_default = { LESS = "-FRX", LESSCHARSET = "utf-8" } }
```

If the user has `$PAGER` set, we take that value and replace the above
table by a scalar set to the value from the environment variable. That
means that anyone who has set `$PAGER` to just `less` will lose both
the `-FRX` and the charset, making e.g. colored output from `jj`
result in escaped ANSI codes rendered by `less`. The lack of those
options might not matter for other tools they use so they might not
have realized that they wanted those options.

This patch attempts to improve the situation by setting the value from
`$PAGER` in `ui.pager.command` so the rest of the config is left
alone.

The default config will still be ignored if you set the scalar
`ui.pager` to e.g. `less`, since that overrides the table.

Closes #2926
2024-05-09 22:35:27 -07:00
..
examples revset: support custom filter extensions 2024-05-06 10:42:01 -04:00
src config: set $LESS and $LESSCHARSET even if $PAGER is set 2024-05-09 22:35:27 -07:00
testing
tests cli: port "branch list" to template 2024-05-10 08:36:38 +09:00
build.rs
Cargo.toml cargo: explicitly indicate paths to publish 2024-04-15 20:37:00 -07:00
LICENSE