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

Add support for pager #9

Closed
martinvonz opened this issue Apr 7, 2021 · 3 comments
Closed

Add support for pager #9

martinvonz opened this issue Apr 7, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@martinvonz
Copy link
Member

No description provided.

@dbarnett
Copy link
Contributor

dbarnett commented Dec 3, 2022

Looks like there is a pager triggered for commands like jj log, but I'm seeing ANSI escape codes:
@ ESC[1;35mbb39c26a29feESC[0m ESC[1;33m(no email configured)ESC[0m ESC[1;36m2022-12-03...

Would it make sense to default to non-colorized output when using a pager or include pointers for configuring a colorized pager?

@martinvonz
Copy link
Member Author

Good catch. I'm not at a computer right now, but I think we just default to less without the -R option. We should improve the default by adding -FRX. We can probably also be helpful and give some hints if the user has confirmed less without -R and it's also not in $LESS.

martinvonz added a commit that referenced this issue Dec 4, 2022
As dbarnett@ reported on #9, our default of `less`, combined with our
default of enabling color on TTYs, means that we print ANSI codes to
`less` by default. Unless the user has set e.g. `$LESS=R`, `less` is
going to escape those codes, resulting in garbage like this:

```
@ ESC[1;35mbb39c26a29feESC[0m ESC[1;33m(no email configured)ESC[0m ESC[1;36m2022-12-03....
```

I guess most of us didn't notice because we have something like
`$LESS=FRX` set.

This patch changes our default from `less` to `less -FRX`. Those are
the flags we're using for our internal hg distribution at Google, and
that has seemed quite uncontroversial.

I added a pointer from the changelog to the tracking issue while at
it.
martinvonz added a commit that referenced this issue Dec 4, 2022
As dbarnett@ reported on #9, our default of `less`, combined with our
default of enabling color on TTYs, means that we print ANSI codes to
`less` by default. Unless the user has set e.g. `$LESS=R`, `less` is
going to escape those codes, resulting in garbage like this:

```
@ ESC[1;35mbb39c26a29feESC[0m ESC[1;33m(no email configured)ESC[0m ESC[1;36m2022-12-03....
```

I guess most of us didn't notice because we have something like
`$LESS=FRX` set.

This patch changes our default from `less` to `less -FRX`. Those are
the flags we're using for our internal hg distribution at Google, and
that has seemed quite uncontroversial.

I added a pointer from the changelog to the tracking issue while at
it.
@martinvonz
Copy link
Member Author

I think we should consider this bug done by #672 (thanks, @chooglen!). I sent #836 to default to less -FRX instead of less without arguments. That should fix the biggest you ran into, @dbarnett. I'll leave the nice-to-have for later (warning when the user is using less without -R).

martinvonz added a commit that referenced this issue Dec 4, 2022
As dbarnett@ reported on #9, our default of `less`, combined with our
default of enabling color on TTYs, means that we print ANSI codes to
`less` by default. Unless the user has set e.g. `$LESS=R`, `less` is
going to escape those codes, resulting in garbage like this:

```
@ ESC[1;35mbb39c26a29feESC[0m ESC[1;33m(no email configured)ESC[0m ESC[1;36m2022-12-03....
```

I guess most of us didn't notice because we have something like
`$LESS=FRX` set.

This patch changes our default from `less` to `less -FRX`. Those are
the flags we're using for our internal hg distribution at Google, and
that has seemed quite uncontroversial.

I added a pointer from the changelog to the tracking issue while at
it.
xxxserxxx pushed a commit to xxxserxxx/jj that referenced this issue Mar 14, 2023
Use the dedicated example tld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants