Skip to content

Increase GH_PAGER precedence#3789

Merged
samcoe merged 1 commit intocli:trunkfrom
cristiand391:increase-gh-pager-precedence
Jun 15, 2021
Merged

Increase GH_PAGER precedence#3789
samcoe merged 1 commit intocli:trunkfrom
cristiand391:increase-gh-pager-precedence

Conversation

@cristiand391
Copy link
Contributor

This PR makes GH_PAGER env var take higher precedence over local config.

When providing GH_PAGER, a user can change/disable the pager per single invocation, some examples:

gh config get pager
> less

GH_PAGER='delta' gh pr diff 3787
... format git diff output with delta instead of less

Ref. #3617 (comment)

Closes #3617

If `GH_PAGER` is exists, set it as the pager even if one is
already set in config.

This allows a user to change/disable the pager per single invocation.
@cristiand391 cristiand391 mentioned this pull request Jun 5, 2021
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

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

This looks good!

I wonder if we need to change anything in gh help environment output. As it stands, this is still accurate:

GH_PAGER, PAGER (in order of precedence): a terminal paging program to send standard output to, e.g. "less".

There is no mention how how this relates to gh config set pager, but maybe there doesn't need to be any mention right now.

@samcoe samcoe merged commit e380d68 into cli:trunk Jun 15, 2021
@cristiand391 cristiand391 deleted the increase-gh-pager-precedence branch June 15, 2021 19:34
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

Successfully merging this pull request may close these issues.

Allow changing or disabling the pager per single invocation

3 participants