-
Couldn't load subscription status.
- Fork 7.3k
Allow disabling pager by setting it to "" #1920
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Allow setting `pager` in config file to an empty string. This disables the pager completely and all output will be unpaged regardless of the PAGER environment variable. This replicates the behaviour of the `core.pager` Git configuration option.
12c4dab to
67b4391
Compare
|
I think you can set the pager to |
|
Setting pager to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code looks good to me. I like having the ability to explicitly disable the pager in configuration file, and also like mirroring the way git handles it. I think we should also specify in pkg/cmd/root/help_topic.go this new way to disable the pager. Going to wait for a second set of eyes before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I like the approach, but since we already generate the user's default configuration file with the pager: (blank value) line, this change would basically disable pager for everyone who hasn't changed the default in their settings, regardless of their PAGER settings.
I'm guessing that the primary need is a way to override PAGER specifically for gh. I'm thinking that we should add an additional GH_PAGER environment variable and also support the special value of pager: cat in the user's config file as a way to disable pager completely. (We should not actually execute cat as a sub-process, since that would be a waste of resources.)
|
@tgyurci Thank you so much for all the PRs! Now that we have two additional mechanisms to override the system PAGER in gh, I'm going to close this. 🙇 |
|
If it worth it, I can extract the config source refining part from it. What do you think? |
Allow setting
pagerin config file to an empty string. This disablesthe pager completely and all output will be unpaged regardless of
the PAGER environment variable.
This replicates the behaviour of the
core.pagerGit configurationoption.