Skip to content

ANSI codes appearing as autocomplete visual artifacting #1558

Closed

Description

@mnooseman

Environment

PS version: 5.1.14409.1018
PSReadline version: 2.1.0-beta1
os: 6.3.9600.16384 (winblue_rtm.130821-1623)
PS file version: 10.0.14409.1005 (rs1_srvoob.161208-1155)
HostName: Visual Studio Code Host
BufferWidth: 218
BufferHeight: 3000

Exception report

Steps to reproduce

Open Latest VSCode + Powershell-Preview extension in RDP session. Attempt to type any cmdlet in the Integrated Shell.

Expected behavior

Autocomplete working properly, showing potential commands.

Actual behavior

Observe that weird auto-completed artifacting appears, which seems to include ANSI codes. In the below image I had Typed "Get-"
image

Activity

  1. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on May 27, 2020
  2. gilescope commented on May 29, 2020

    @gilescope

    I wonder if you can integrate windows terminal into vscode because that’s the true fix for ansi codes appearing.

    Sent with GitHawk

  3. vexx32 commented on May 29, 2020

    @vexx32

    Visual Studio Code implements its own terminal for everything using xterm.js. It's also cross-platform so I don't think they can integrate a Windows-only component.

  4. SeeminglyScience commented on May 29, 2020

    @SeeminglyScience
    Collaborator

    If they were running a build of Windows that could install terminal (they appear to be running server 2k12), the escape codes would work fine anyway.

    iirc PSReadLine has a check for when the OS doesn't support ANSI escapes and should revert to a simplier renderer.

    Some possibilities:

    1. bug in the check
    2. bug in the simple terminal interface
    3. maybe some escape sequences were added directly in the renderer bypassing the check

    I never really looked at the code for the simple interface so some of the above might be nonsensical.

  5. daxian-dbw commented on Jun 4, 2020

    @daxian-dbw
    Member

    Thanks for reporting the issue. The issue has been fixed in the master branch (#1496), by making the predictive suggestion feature off by default. The predictive suggestion feature can be turned on by Set-PSReadLineOption -PredictionSource History (by default the PredictionSource is None). But if PSReadLine is used in a host that doesn't support VT100, that feature cannot be enabled -- Set-PSReadLineOption -PredictionSource History will throw error accordingly.

  6. ghost removed
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Jun 4, 2020
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions