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

Terminal in VSCode Insiders not able to display special characters #211922

Closed
GBoGH opened this issue May 3, 2024 · 29 comments · Fixed by #215452
Closed

Terminal in VSCode Insiders not able to display special characters #211922

GBoGH opened this issue May 3, 2024 · 29 comments · Fixed by #215452
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release important Issue identified as high-priority terminal-shell-integration Shell integration, command decorations, etc. terminal-shell-pwsh An issue in the terminal specific to PowerShell verified Verification succeeded

Comments

@GBoGH
Copy link

GBoGH commented May 3, 2024

Type: Bug

The terminal in VSCode - insiders is unable to display special characters in terminals after latest update
How it looks in VSCode:
image

How it looks in VSCode - insiders
image

The font settings are the exact same for both versions

VS Code version: Code - Insiders 1.90.0-insider (a1f2ea3, 2024-05-03T05:49:15.006Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 x 2304)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.78GB (16.50GB free)
Process Argv --crash-reporter-id 36ec293a-880e-4386-812a-8d1608e38588
Screen Reader no
VM 0%
Extensions (40)
Extension Author (truncated) Version
better-comments aar 3.0.2
TabOut alb 0.2.2
Bookmarks ale 13.5.0
doxdocgen csc 1.4.0
githistory don 0.6.20
gitlens eam 14.9.1
copilot Git 1.184.0
copilot-chat Git 0.14.1
latex-workshop Jam 9.20.1
rainbow-csv mec 3.11.0
git-graph mhu 1.30.0
autopep8 ms- 2024.0.0
debugpy ms- 2024.4.0
isort ms- 2023.10.1
pylint ms- 2023.10.1
python ms- 2024.4.1
vscode-pylance ms- 2024.4.1
jupyter ms- 2024.4.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.17
tensorboard ms- 2023.10.1002992421
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-powertoys ms- 0.1.1
vscode-jupyter-slideshow ms- 0.1.6
remote-wsl ms- 0.88.2
cpptools ms- 1.20.3
cpptools-extension-pack ms- 1.3.0
hexeditor ms- 1.10.0
vsliveshare ms- 1.0.5918
autodocstring njp 0.6.1
advanced-new-file pat 1.2.2
material-icon-theme PKi 5.1.0
r-debugger RDe 0.5.4
r REd 2.8.2
markdown-preview-enhanced shd 0.8.13
errorlens use 3.17.0
intellicode-api-usage-examples Vis 0.2.8
vscodeintellicode Vis 1.3.1
markdown-all-in-one yzh 3.6.2
material-theme zhu 3.17.2

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vsc_aacf:30263846
vscod805cf:30301675
vsaa593cf:30376535
py29gd2263:31024238
c4g48928:30535728
2i9eh265:30646982
962ge761:30841072
pythongtdpath:30726887
welcomedialog:30812478
pythonidxpt:30768918
pythonnoceb:30776497
asynctok:30898717
dsvsc013:30777762
dsvsc014:30777825
dsvsc015:30821418
pythontestfixt:30866404
pythonregdiag2:30926734
pyreplss1:30879911
pythonmypyd1:30859725
pythoncet0:30859736
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
cppperfnew:30980852
ccp2r3:30958153
pythonait:30973460
showvideot:31016890
chatpanelt:31014475
0ee40948:31013168
pythoncenvpt:31022790
a69g1124:31018687
j0bi8933:31021562
dvdeprecationcf:31036533
pythonprt:31036556
dwnewjupytercf:31035177

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal-shell-integration Shell integration, command decorations, etc. terminal-shell-pwsh An issue in the terminal specific to PowerShell labels May 3, 2024
@Tyriar Tyriar added this to the May 2024 milestone May 3, 2024
@Tyriar
Copy link
Member

Tyriar commented May 3, 2024

@GBoGH can you share your starship.toml? Also are you using Windows PowerShell (powershell.exe) or pwsh 6+? Could you get the version of that via pwsh --version?

@homezada
Copy link

homezada commented May 3, 2024

Same issue for us using bash 5.0.17(1) so might not be pwsh dependent.

Terminal prompt now not showing special characters on latest insiders update 1.90.0 e.g. \x1b[01\x3b34m~/code/project1\x1b[00m (main))$ ~/code/project1 (main))$

@Tyriar
Copy link
Member

Tyriar commented May 3, 2024

@homezada actually got a fix in for bash in #211963

@GBoGH
Copy link
Author

GBoGH commented May 3, 2024

@Tyriar

Where can i get the starship.toml?
The powershell version is: 7.4.2

@Kevazy
Copy link

Kevazy commented May 15, 2024

I have the same exact problem, and the following suggestion finally fixed it on my end: #212130 (comment)

@GBoGH
Copy link
Author

GBoGH commented May 15, 2024

I am not sure I understand what the comment is trying to say. I am supposed to replace my shellintegration.ps1 with the one from commit 1e790d7 but that commit has nothing to do with shellintegration.ps1. The only commits affecting shellintegration.ps1 from around that time are 250211e and 69f334d

@Kevazy
Copy link

Kevazy commented May 15, 2024

I agree, the instructions could have been clearer. The commit selection does seem a bit random, but what I did was clicking 'Browse files' on the commit and found the shellintegration.ps1 from that repository version. Here's a link to get there directly: shellintegration.ps1 [1e790d7]

@only-su
Copy link

only-su commented Jun 7, 2024

It was pushed to the official build. I'm having this issue and I dont rememeber ever joining any kind of insider program.

@Tyriar
Copy link
Member

Tyriar commented Jun 18, 2024

To verify:

  1. Install oh-my-posh https://ohmyposh.dev/
  2. Open a PowerShell terminal
  3. Activate oh-my-posh, you should not see the \x escapes as shown above

@Etrinque
Copy link

Same issue here. oh-my-posh, powershell, issue only with vscode, windows term looks as intended.
Screenshot 2024-06-18 110223

@Tyriar
Copy link
Member

Tyriar commented Jun 19, 2024

This should be fixed in v1.90.2 which was just released

@only-su
Copy link

only-su commented Jun 19, 2024

Can confirm as fixed. Thanks for the work!

@GiitMM
Copy link

GiitMM commented Jun 20, 2024

confirm as fixed and work well without needing to disable terminal.integrated.shellIntegration.enabled setting!

image

@frasermclean
Copy link

Looks good again!

@mikeasage
Copy link

Looks good to me too!!

@martindotpy
Copy link

martindotpy commented Jun 21, 2024

This morning, I updated my VS Code, activated the terminal.integrated.shellIntegration setting, but I am still experiencing the same issue (especially when I try to clear the terminal with CTRL+L). I am using Windows 10 Pro for Workstations x64,
AMD Ryzen 5 5600X 6-Core Processor, and Nvidia 720 GPU.

terminal-bug

@BingFengHung
Copy link

Still same issue

@Tyriar
Copy link
Member

Tyriar commented Jun 21, 2024

@martindotpy what shell/prompt is that?

@martindotpy
Copy link

@Tyriar It's the PowerShell from the Microsoft Store. Special characters appear when I press Ctrl + L to clear the terminal. I also have the same problem in Git Bash, but it happens when I execute a command. In both cases, I am using Oh My Posh.

git-bash

@wjrogers
Copy link

I was also having a related? problem with PowerShell integration since the 1.90 release. The recent 1.90.2 update has changed the outcome a little, but not fixed it. I get output like the below when I open a new pwsh terminal, and often the terminal stops responding after executing a command or two.

Version: 1.90.2 (user setup)
Commit: 5437499feb04f7a586f677b155b039bc2b3669eb
Date: 2024-06-18T22:34:26.404Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19045

I have this PowerShell profile. I thought any of PSFzf, zoxide, or the encoding settings could be the culprit, so I tried removing each one. Oddly, removing any combination of them doesn't fix the problem, but completely blanking out the file fixes it (second image below). It all worked fine in vscode prior to 1.90.

# UTF-8 encoding!
[console]::InputEncoding = [console]::OutputEncoding = [System.Text.UTF8Encoding]::new()

# environment
$Env:FZF_DEFAULT_COMMAND = 'fd --type file --color=always --follow --hidden --exclude .git'
$Env:FZF_DEFAULT_OPTS = '--ansi --layout=reverse --height 40%'

# PSFzf
Remove-PSReadlineKeyHandler 'Ctrl+r'
Import-Module PSFzf

# zoxide
if (Get-Command "zoxide" -ErrorAction Ignore) {
  Invoke-Expression (& { (zoxide init powershell | Out-String) })
}

image
image

@Tyriar
Copy link
Member

Tyriar commented Jun 24, 2024

@wjrogers you have the experimental suggest setting enabled, disabling that will fix it. What version of PowerShell is that you're using? Currently in Insiders we force suggest to be disabled on Windows PowerShell (5), but if you're experiencing it in a latter version maybe we need to disable it in older versions of Windows too.

@wjrogers
Copy link

wjrogers commented Jun 24, 2024

>pwsh --version
PowerShell 7.4.2

@Tyriar Are you referring to a different setting? terminal.integrated.suggest.enabled is not set. (I was wrong; see below.) (Not sure if it's relevant, but PowerShell suggestions do work in Windows Terminal.)

image
image

@wjrogers
Copy link

@Tyriar OOPS, I did have an old version of that setting in my settings.json, and removing it did indeed fix the problem. Thank you.

{
  "terminal.integrated.shellIntegration.suggestEnabled": true
}

@tymokvo
Copy link

tymokvo commented Jun 24, 2024

Is there a separate issue tracking this behavior with posh-git? I do not use OhMyPosh and am still getting the same behavior with VSCode 1.90.2.

image

The workaround of invoking pwsh from within the VSCode terminal does work.

bricefriha pushed a commit to bricefriha/vscode that referenced this issue Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release important Issue identified as high-priority terminal-shell-integration Shell integration, command decorations, etc. terminal-shell-pwsh An issue in the terminal specific to PowerShell verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.