Instead of the "Display all <n> possibilities (y/n)" prompt, make MenuComplete use in-place paging to show completions that exceed the -CompletionQuery threshold

Open
#2,306 0 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
cli

Research direction

Start at the MenuComplete entry point and trace how Set-PSReadLineOption -CompletionQueryItems controls the current completion display. Review the existing PgUp and PgDown behavior, then define paging that keeps filtering and tooltip output available instead of showing the Display all prompt. Done means large completion sets page in place within the available screen area.

Written by the indexing model from the issue text.

Description

Issue-Enhancement Issue-Triaged

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 #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).

Dominant language
C#
Stars
4.4k
Forks
341
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/PSReadLine

All issues in PowerShell/PSReadLine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.