InquirerPy icon indicating copy to clipboard operation
InquirerPy copied to clipboard

Feature: Showing keybinding list in prompt

Open pykenny opened this issue 2 years ago • 0 comments

Purpose

Just like some Text-UI applications, it would be useful to provide option to show available keybindings as hint, to tell users how to interact with the question/application.

Conceptual Example

Adds extra line in the output to provide keybinding information about current question. When border is enabled, then the hint can be shown on the bottom border:

? Pick your favourites: (select at least 1)
┌────────────────────────────────────────────────────┐
│  ○ Apple                                           │
│❯ ○ Orange                                          │
│  ○ Pear                                            │
└──────────────[Space]Toggle [Enter]Confirm [q]Exit──┘

Extra lines can be added if terminal width is not enough to show full instructions in single line.

pykenny avatar Jan 10 '24 06:01 pykenny