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

Closed
krobelus opened this issue Oct 20, 2019 · 1 comment
Closed

Comments

@krobelus
Copy link
Member

@krobelus 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
@floam
Copy link
Member

@floam 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 removed this from the fish-future milestone Oct 30, 2019
@zanchey zanchey added this to the fish 3.1.0 milestone 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.
Projects
None yet
Development

No branches or pull requests

3 participants