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

builtin's --help should use pager when the output does not fit in the screen #6227

krobelus opened this issue Oct 20, 2019 · 1 comment


Copy link

krobelus commented Oct 20, 2019

E.g. complete -h prints a bunch of useful information but I almost always need to scroll up a or use a pager (\ep or \eh in this case). I think it should use a pager by default if the output is a tty and there are more lines than one screenful, just like git diff and others.

Probably also for functions.

@zanchey zanchey added this to the fish-future milestone Oct 20, 2019
Copy link

floam commented Oct 20, 2019

This is a good idea, and it doesn't need to be implemented in the builtins: __fish_print_help is the fish function invoked for this and it's easy to improve.

krobelus added a commit to krobelus/fish-shell that referenced this issue Oct 20, 2019
Every builtin or function shipped with fish supports flag -h or --help to
print a slightly condensed version of its manpage.
Some of those help messages are longer than a typical screen;
this commit pipes the help to a pager to make it easier to read.

As in other places in fish we assume that either $PAGER or "less" is a
valid pager and use that.

In three places (error messages for bg, break and continue) the help is
printed to stderr instead of stdout.  To make sure the error message is
visible in the pager, we pass it to builtin_print_help, every call of which
needs to be updated.

Fixes fish-shell#6227
@zanchey zanchey modified the milestones: fish-future, fish 3.1.0 Oct 30, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

Successfully merging a pull request may close this issue.

3 participants