-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Milestone
Description
Case 1: several modules each have a command with the same name (by coincidence)
Case 2: several top-level modules reference the same base module (e.g. having it as NestedModules with CmdletsToExport = '*')
In both cases tab-complete for such command fails and PS offers several instances of command with the same name which does not make sense from autocomplete point of view.
For example:
PS /home/pi> Test-TabCompl #press Tab here
Test-TabCompletion Test-TabCompletion Test-TabCompletion Test-TabCompletion It looks like a new 'instance' in the list is getting added after according module is imported.
Also this list seems to be saved across PS sessions, so if at least 2 modules with the same command were ever imported - the tab-completion for the command will be broken forever.
Steps to reproduce
- Create several copies of the same module, rename the copies;
- Import each copy of the module;
- optionally, can exit PS here and start a new one;
- Try to tab-complete a command from the module.
PS /home/pi> Get-Module -ListAvailable
Directory: /usr/local/share/powershell/Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
#...
Manifest 0.1.1 TestTabCompletion
Manifest 0.1.1 TestTabCompletion2
Manifest 0.1.1 TestTabCompletion3
Manifest 0.1.1 TestTabCompletion4
#...
PS /home/pi> ipmo TestTabCompletion
PS /home/pi> ipmo TestTabCompletion2
PS /home/pi> ipmo TestTabCompletion3
PS /home/pi> ipmo TestTabCompletion4
PS /home/pi> Test-TabComple # pressed Tab here
Test-TabCompletion Test-TabCompletion Test-TabCompletion Test-TabCompletion
PS /home/pi> exit
pi@raspberrypi:~ $ sudo ./PS610P2/pwsh
PowerShell v6.1.0-preview.2
Copyright (c) Microsoft Corporation. All rights reserved.
PS /home/pi> Test-TabComple # pressed Tab here
Test-TabCompletion Test-TabCompletion Test-TabCompletion Test-TabCompletionExpected behavior
Tab-completion on the command should succeed.
Actual behavior
Tab-completion for command fails.
Environment data
Name Value
---- -----
PSVersion 6.1.0-preview.2
PSEdition Core
GitCommitId v6.1.0-preview.2
OS Linux 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Metadata
Metadata
Assignees
Labels
In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime