Skip to content
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

ANSI code printed in the Terminal pane on windows powershell #4859

Open
cderv opened this issue Oct 1, 2024 · 0 comments
Open

ANSI code printed in the Terminal pane on windows powershell #4859

cderv opened this issue Oct 1, 2024 · 0 comments

Comments

@cderv
Copy link

cderv commented Oct 1, 2024

System details:

Positron and OS details:

Positron Version: 2024.09.0 (user setup) build 103
Code - OSS Version: 1.93.0
Commit: 8274fe26a1582fa0dd0096d6631b500f591416c4
Date: 2024-09-30T02:52:11.236Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

Terminal details:

Using Powershell 7.4.5 pwsh on Windows 10.0.22631.0

Describe the issue:

image

When opening a new terminal in PowerShell I see this above. It seems the sequence \x1b[0m is an ANSI escape code used in terminal environments to reset the text formatting.

I am surprised to see it, while opening same terminal in VSCODE does not show it.

Is this something on my side ? Or does Positron use this specific command and somehow it is shown in terminal pane ?

I see it used several place across code - though I don't think this is working for powershell.

Write-Host "\x1b[0m"
\x1b[0m

My understanding is that Powershell expect rather "`e[0m"

This is available from powershell 6 I think: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_special_characters?view=powershell-7.4#escape-e

For example

image

So maybe this ANSI code needs to be adapted in powershell context ?

Steps to reproduce the issue:

  1. Open Positron on Windows with powershell 7 available
  2. Open a terminal windows with powershell

Expected or desired behavior:

Terminal does not show \x1b[0m character

Were there any error messages in the UI, Output panel, or Developer Tools console?

Not relevant (I think)

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

1 participant