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

MenuComplete behaves oddly in folder with many (>50) items #3344

Open
3 tasks done
MartinSGill opened this issue Jun 14, 2022 · 1 comment
Open
3 tasks done

MenuComplete behaves oddly in folder with many (>50) items #3344

MartinSGill opened this issue Jun 14, 2022 · 1 comment
Labels
Resolution-By Design

Comments

@MartinSGill
Copy link

@MartinSGill MartinSGill commented Jun 14, 2022

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

N/A

Screenshot

image

Environment data

PS Version: 7.3.0-preview.4
PS HostName: ConsoleHost (Windows Terminal)
PSReadLine Version: 2.2.2
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 122
BufferHeight: 29

Steps to reproduce

Create many sub-folders (or files), e.g.

@(1..60) | % { mkdir Some.Very.Very.Very.Very.Long.Prefix.Folder.With$_ }

Set MenuComplete as handler

Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete

Type: ls Som<TAB>

Expected behavior

Same as when

Set-PSReadLineKeyHandler -Key Tab -Function Complete

i.e.

Current text at cursor updated to Some.Very.Very.Very.Very.Long.Prefix.Folder.With

Actual behavior

A list of folders is displayed (no menu) and the text at the cursor is not updated.

Presumably, there is too much data to render a menu and MenuComplete tries to fall back to the Complete function, but it seems to not do this correctly.

I would expect the text at cursor to be updated to the longest unique value (as described in the docs)

@msftbot msftbot bot added the Needs-Triage 🔍 label Jun 14, 2022
@daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Jun 21, 2022

This is the by design behavior. It's not falling back to Complete, but falling back to the "Display all xxx possibilities? (y or n)" UI, which is also used by Complete. For Complete, the step that completes to the longest unique sub-string is done before getting to the "Display all possibilities" UI.

@daxian-dbw daxian-dbw added Resolution-By Design and removed Needs-Triage 🔍 labels Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-By Design
Projects
None yet
Development

No branches or pull requests

2 participants