Description
Refs #239519, #233799, #240408, #239515, #239518, #241252, #241220, #239977, #239028, #240104, #233368, #238085, #239022, #237979, #240661, #239978
- Linux @joshspicer
- macOS @chrmarti
- Windows @legomushroom
Complexity: 5
Authors: @meganrogge, @Tyriar
Roles: Developer, Engineering Manager
Overview
We’ve significantly improved shell completions across several shells—bash, zsh, fish, and pwsh. This update enhances ghost text detection, sorting, and documentation support among other areas. The following sections outline detailed steps to test each improvement.
Pre-requisites
- Terminal Settings:
Ensure thatterminal.integrated.suggest.enabled
is enabled in your settings. - Customization:
Further customize settings underterminal.suggest
as needed.
Testing Instructions
1. Improved Ghost Text Detection
-
Background:
Completions infish
were previously flaky due to incorrect ghost text parsing. Now, they should appear consistently. Additionally, inline suggestions (denoted with a ⭐ icon) should appear as the top suggestions. -
Steps:
- Enable and configure
terminal.integrated.suggest.inlineSuggestion
. - Use a shell that supports inline completions and verify that suggestions appear consistently.
- Confirm that ghost text displays properly even if not styled as dimmed/italic.
- Enable and configure
2. Improved Sorting
-
Background:
Sorting now prioritizes commands with inline descriptions, details, and documentation. Commands with specs (or builtins) should appear before executables pulled from$PATH
. -
Steps:
- Type
co
and verify thatcode
(which has a spec) appears beforecol
(an executable). - Check that file suggestions starting with a–z are prioritized over those beginning with
_
, and that punctuation is ignored when sorting.
- Type
3. Enhanced Documentation Support
-
Background:
Forbash
andzsh
, completions now include parsed documentation fromman
/help
commands:- Inline: A concise command description.
- Details Widget: Displays command arguments at the top and the full markdown-formatted description below.
-
Steps:
- See the list of example
zsh
commands that should have these properties here. Forbash
, runcompgen -b
to get the list of builtin commands. - Verify that each builtin command suggestion displays a brief inline description.
- Open the details widget to ensure that command arguments and full documentation are formatted correctly.
- See the list of example
4. Aliases Support
-
Background:
Command aliases now appear in the suggestions list. Note that spec information may be missing for some aliases (see Issue #240374). -
Steps:
- Test various aliases and verify that they appear in the suggestion list.
5. File Path Extensions Filtering
-
Background:
File suggestions are now filtered by extensions for specific commands:- For
python3
, only.py
files should be listed. - For
node
, only.mjs
,.js
, and.cjs
files should appear.
- For
-
Steps:
- Run
python3
in the terminal and confirm that only files ending in.py
are suggested. - Run
node
and verify that only the specified file extensions are displayed.
- Run
6. Path Resource Completion (Windows Specific)
-
Background:
Absolute path completion on Windows has been improved. -
Steps:
- Test drive suggestions:
- Type
cd |
and verify that available drives (e.g.,C:\
,D:\
) are shown.
- Type
- Test directory suggestions:
- Type
cd C:\|
and confirm that directories (e.g.,C:\Windows
) with the same prefix are displayed.
- Type
- Test drive resolution:
- Type
cd :|
to verify that all drives are shown.
- Type
- For
bash
andzsh
, check that using~
correctly resolves to the home directory.
- Test drive suggestions:
7. Configuring quick suggestions
-
Background:
It can now be configured when suggestions automatically show up (aka. quick suggestions). -
Steps:
- Configure
terminal.integrated.suggest.quickSuggestions
and make sure each option works as expected.
- Configure