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

[Query] Helping user with key binding cues. #7

Closed
piyush-das opened this issue May 30, 2021 · 3 comments
Closed

[Query] Helping user with key binding cues. #7

piyush-das opened this issue May 30, 2021 · 3 comments
Labels
enhancement New feature or request solved (closable)

Comments

@piyush-das
Copy link

Hi,

Besides the prompt message, is a there a way to give cues about the key bindings (like some sub text which has a greyed out styling )? This would be particularly useful in the case where there is a multi-select or a single selection available. Additionally it might also inform the user that using tab would help to kick in the auto-completion.

Or perhaps this information section could also be given to indicate additional information which might help the user in answering or making selections.

Thanks

@kazhala
Copy link
Owner

kazhala commented May 30, 2021

Hi @piyush-das ,

At the moment, you can leverage the parameter instruction to provide some keybinding information to the user.

result = inquirer.select(
    message="Select one:", choices=[1, 2, 3], default=2, instruction="ctrl-p, ctrl-n to navigate"
).execute()

The instruction will be printed using a different colour behind the question. You can also customise the instruction style. It is documented here.

It is not currently supported for none list type prompts, which I think probably should...I'll add that to next release. It probably should also have an option to include the instructions in the second line or a dedicated area?

@piyush-das
Copy link
Author

piyush-das commented May 30, 2021

Yeah , the concept of customizable instructions to prompts seems like a great addition.As long as it doesnt clutter the prompt itself even a dedicated area would be great. Thanks

@kazhala
Copy link
Owner

kazhala commented Oct 12, 2021

The latest release 0.3.0 now includes the parameter `long_instructions" which you can use to print longer instructions such as keybindings which will be displayed at the bottom of the screen.

@kazhala kazhala closed this as completed Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request solved (closable)
Projects
None yet
Development

No branches or pull requests

2 participants