Skip to content

ANSI codes appearing as autocomplete visual artifacting #1558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mnooseman opened this issue May 27, 2020 · 4 comments
Closed

ANSI codes appearing as autocomplete visual artifacting #1558

mnooseman opened this issue May 27, 2020 · 4 comments

Comments

@mnooseman
Copy link

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

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label May 27, 2020
@gilescope
Copy link

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

Sent with GitHawk

@vexx32
Copy link

vexx32 commented May 29, 2020

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.

@SeeminglyScience
Copy link
Contributor

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.

@daxian-dbw
Copy link
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.

@ghost ghost removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants