Skip to content
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

Setting PAGER=less in the environment causes ANSI escape sequences to appear by default #3502

Open
64 opened this issue Apr 14, 2024 · 1 comment

Comments

@64
Copy link

64 commented Apr 14, 2024

Just tinkering with jj locally for the first time. I set PAGER=less in my environment. This seems to override the default pager 'less -FRX' and hence ANSI escape sequences are not rendered properly (since -FRX is not passed).

Steps to Reproduce the Problem

Run PAGER=less jj --help with a clean configuration

Expected Behavior

Help is rendered either in plain text or with escape sequences processed properly

Actual Behavior

ANSI escape sequences are shown:

$ PAGER=less jj --help
Jujutsu (An experimental VCS)

To get started, see the tutorial at https://github.com/martinvonz/jj/blob/main/docs/tutorial.md.

ESC[1mESC[4mUsage:ESC[0m ESC[1mjjESC[0m [OPTIONS] <COMMAND>
[...]

Note that env -u PAGER jj --help works as intended.

Specifications

  • Platform: Linux
  • Version: 0.16.0
@martinvonz
Copy link
Owner

If the color config is set to "auto" (the default), I suppose we could check if the pager is set to less without -R and disable color if it is. Or we can always set LESS=FRX when calling the pager. #2928 attempted that but was abandoned in favor of adding a builtin pager to use by default. Maybe we should revive that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants