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

Incorrect Auto-Completion When Using Tab #23244

Closed
5 tasks done
JackW6809 opened this issue May 10, 2024 · 4 comments
Closed
5 tasks done

Incorrect Auto-Completion When Using Tab #23244

JackW6809 opened this issue May 10, 2024 · 4 comments
Labels
Resolution-Answered The question is answered.

Comments

@JackW6809
Copy link

Prerequisites

Steps to reproduce

Typing ip shows ipconfig as a suggested auto-completion. However, when pressing TAB it auto-completes it to ipal

Expected behavior

Pressing TAB button when presented with auto-complete should fill in the rest with what we are presented with.

Actual behavior

Pressing TAB button when presented with auto-complete instead fills it to a random cmdlet it thinks is correct, which is what happens on PowerShell 5.1.

Error details

No response

Environment data

PS C:\Users\jwillis> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

image
https://github.com/PowerShell/PowerShell/assets/53652452/67cc3405-8f92-4016-9b87-4651090b1f8b

@JackW6809 JackW6809 added the Needs-Triage The issue is new and needs to be triaged by a work group. label May 10, 2024
@MartinGC94
Copy link
Contributor

That's not tab completion, it's prediction. The standard way to accept predictions is the right arrow key, you can bind it to Tab like this: Set-PSReadLineKeyHandler -Function AcceptSuggestion -Chord Tab but then you won't have your standard tab completion so I'd advice against it.

@jhoneill
Copy link

You're seeing IPConfig because that was the most recent command beginning with IP that you used.
If I type IP I get IPMO module name

As @MartinGC94 says tab cycles through all commands beginning IP in alphabetical order, right arrow pulls back the whole of the line by default (so If you had ipconfig /flushdns you'd get the switch)
In my profile I've set ctrl right arrow to pull back a word at a time, which IMHO makes the feature significantly more useful.

@StevenBucher98 StevenBucher98 added Resolution-Answered The question is answered. and removed Needs-Triage The issue is new and needs to be triaged by a work group. labels May 13, 2024
Copy link
Contributor

This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.

Copy link
Contributor

microsoft-github-policy-service bot commented May 14, 2024

📣 Hey @JackW6809, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Answered The question is answered.
Projects
None yet
Development

No branches or pull requests

4 participants