Description
Description of the new feature/enhancement
When a given tab completion invoked via the MenuComplete
function yields more items than the threshold specified via Set-PSReadLineOption -CompletionQueryItems <n>
(default is 100
), the tab-completion UX changes fundamentally:
- Instead of completions, a
Display all <n> possibilities (y/n)
prompt is shown, which is itself somewhat disruptive. - On opting in, the following UX benefits are lost, because a static list is printed before the command being edited is redisplayed:
- Interactive, live filtering of completions as you type.
- Additional information about the currently selected item in a separate line below the completions (what Show ToolTip when completions exceed CompletionQueryItems #1844 refers to as ToolTips).
A real-life example of where this would be useful is to enable the -Encoding
parameters to then offer all available encodings (consistent with the parameter type), without detriment to those users only interested in the PowerShell-defined ones - see #1844
Proposed technical implementation details (optional)
- Never show the
Display all <n> possibilities (y/n)
prompt. - Instead, provide in-place paging that preserves the UX benefits.
Loosely speaking, MenuComplete
could act like the more
or less
utilities, only confined to the portion of the screen that fits -CompletionQueryItems
values or as much as will fit on a single screen (with room for the "ToolTip" line).
PgUp / PgDown, which already work among the items shown on the one and only "page", could be used for paging (whereas Home and End act on the command line being edited).