Change:
Steps to Reproduce: and press :bug: intellisense completion was for the argument instead of running the command I have a pretty strong muscle memory to run that command, so now I need to remember to press escape before pressing enter !
this is bad enough that I've turned the feature off, I can't even use
I also hit these issues particularly with : ! !
one change that would make this much less painful: ctrl+z should undo the auto-complete change as a single action (as is the case with the text editor). I press enter really quickly, after typing what I want, and if auto-complete provides something I didn't want, ctrl+z will undo one character at a time.
Well powershell does support ctrl+z itself. We may be able to undo everything, or nearly everything by using bracketed paste mode, since you can paste something and undo it fine.
Just tried with Posh-Git and while the commands () and aliases ( in mine) work, it still doesn't suggest after checkout: <img width="859" alt="Screenshot 2024-06-14 at 9 56 45 AM" src=""
doesn't show files/folders so we couldn't use that. Maybe using the current completion call, but also providing , , etc. when there are only and entries?
Looks promising <img width="861" alt="Screenshot 2024-06-14 at 10 11 11 AM" src=""

Discussion:
$completions = TabExpansion2 -inputScript $completionPrefix -cursorColumn $cursorIndex if ($null -ne $completions.CompletionMatches) { $result += ";$($completions.ReplacementIndex);$($completions.ReplacementLength);$($cursorIndex);" <del> $result += $completions.CompletionMatches | ConvertTo-Json -Compress </del> <ins> if ($completions.CompletionMatches.Count -gt 0 -and $completions.CompletionMatches.Where({ $_.ResultType -eq 3 -or $_.ResultType -eq 4 })) { $json = [System.Collections.ArrayList]@($completions.CompletionMatches) # Add . and .. to the completions list $json.Add([System.Management.Automation.CompletionResult]::new( '.', '.', [System.Management.Automation.CompletionResultType]::ProviderContainer, (Get-Location).Path) ) $json.Add([System.Management.Automation.CompletionResult]::new( '..', '..', [System.Management.Automation.CompletionResultType]::ProviderContainer, (Split-Path (Get-Location) -Parent)) ) $result += $json | ConvertTo-Json -Compress } else { $result += $completions.CompletionMatches | ConvertTo-Json -Compress } </ins> } } # If there is no space, get completions using CompletionCompleters as it gives us more

if (!Array.isArray(completionList)) { completionList = [completionList]; } const completions = completionList.map((e: any) => { return new SimpleCompletionItem({ label: e.ListItemText,

this._leadingLineContent = this._promptInputModel.value.substring(0, this._promptInputModel.cursorIndex); // If there's no space it means this is a command, add cached commands list to completions const firstChar = this._leadingLineContent.length === 0 ? '' : this._leadingLineContent[0]; if (this._leadingLineContent.trim().includes(' ') || firstChar === '[') {

const completionText = completion.completionText ?? completion.label; const finalCompletionRightSide = completionText.substring((this._leadingLineContent?.length ?? 0) - (lastSpaceIndex === -1 ? 0 : lastSpaceIndex + 1)); <ins> // Hide the widget if there is no change if (finalCompletionRightSide === additionalInput) { this.hideSuggestWidget(); return; } </ins> // Get the final completion on the right side of the cursor if it differs from the initial // propmt input state let finalCompletionLeftSide = completionText.substring(0, (this._leadingLineContent?.length ?? 0) - (lastSpaceIndex === -1 ? 0 : lastSpaceIndex + 1));

"id": "workbench.action.terminal.acceptSelectedSuggestion" }, { <del> "type": "sendText", "data": "s" }, { </del> "type": "output", "data": "u001b[?25lu001b[93mu001b[3;3Hlsu001b[97mu001b[2mu001b[3msbu001b[?25h" },