Skip to content

Predictive text implementation is terrible #5169

Open

Description

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

D:\msys64\msys2_shell.cmd -ucrt64 -defterm -here -full-path -no-start

Screenshot

Predictive text can be a really useful feature but it's implementation here is terrible.

  1. Suggested text here is the exact same colour as what I've typed. It needs to be more distinguishable.
  2. There's no way (that I can fathom) to simply dismiss the suggestion
  3. There's no way (that I can fathom) to accept a subset of the suggestion, e.g. just the next word

There may be some obtuse way to configure these things, but I shouldn't have to do that, these are reasonable expectations out of the box.

Image

Environment data

7.6.2

Steps to reproduce

Type something in powershell

Expected behavior

useful predictive text that I can distinguish from typed text, and dismiss or partially accept

Actual behavior

confusing indistinguishable predictive text that I cannot dismiss or partially accept

Activity

  1. sharpchen commented on Jun 28, 2026

    @sharpchen
    Contributor

    It's not the same color, you can test it on windows default conhost.
    Windows Terminal has inappropriate color map for this.

  2. mattcargile commented on Jul 28, 2026

    @mattcargile

    For Item 1, it does appear like the Parameter and Inline Suggestion are the same. Could check Get-PSReadlineOption. I do see the italics difference.

    For Item 2, it appears you are correct, there isn't a way to only dismiss the suggestion. .RevertLine or Escape clear the entire line.

    Item 3, accept next suggestiong word, can be implemented like the below. I'm in Vi edit mode so one can remove the -ViMode Insert portion if so inclined and of course change the -Chord.

    #region For part way completion of History PredictionSource
    Set-PSReadLineKeyHandler -Chord 'Ctrl+Y' -BriefDescription 'NextWordAndAcceptNextSuggestionWord' -Description 'Move cursor one word to the right in the current editing line and accept the next word in suggestion when it''s at the end of current editing line' -ViMode Insert -ScriptBlock {
        param($key, $arg)
    
        $line = $null
        $cursor = $null
        [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
    
        if ($cursor -lt $line.Length) {
            [Microsoft.PowerShell.PSConsoleReadLine]::NextWord($key, $arg)
        } else {
            [Microsoft.PowerShell.PSConsoleReadLine]::AcceptNextSuggestionWord($key, $arg)
        }
    }
    #endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions