microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.32k stars 28.9k forks source link

Terminal reprints path and duplicates characters when using some unicode chars on Windows #143103

Closed misaka00251 closed 10 months ago

misaka00251 commented 2 years ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. Install oh-my-posh and use the theme here
  2. Run anycommand in VSCode terminal

2022-02-12_13-28-04

By installing another fresh Visual Studio Code won't solve either.

For escape sequence logging:

image

meganrogge commented 2 years ago

can you toggle screen cast mode and make a new gif of it happening?

Also, can you try this in an external terminal and confirm it doesn't happen?

misaka00251 commented 2 years ago

Sure, here you go: 2022-02-16_13-51-35

It didn't happen in external terminal: 2022-02-12_13-29-54

misaka00251 commented 2 years ago

I found the Unicode problem in my theme. In my theme, this block have a [variation selector](https://en.wikipedia.org/wiki/VariationSelectors(Unicode_block)) \ufe0f.

        {
          "background": "#0077c2",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "template": " PE\u2197\ufe0fKO\u2198\ufe0f "
          },
          "style": "powerline",
          "type": "text"
        },

Without the variation selector the character still renders fine, but there's no additional information about presentation.

Strangely this only happens in VSCode, remove \ufe0f and there's no more problem.

demcgovern commented 2 years ago

I'm experiencing this issue as well, though it's only happening with the first character. I'm using starship.

About:

image

Integrated Terminal:

Recording 2022-04-25 at 21 49 53

Windows Terminal:

Recording 2022-04-25 at 21 56 41

ehawman-rosenberg commented 2 years ago

Confirming that I see this issue as well. Using Oh-My-Posh on Windows

image (typed "abcdefg")

Hamdysaad20 commented 2 years ago

i have the same issue

Tyriar commented 2 years ago

This happens because of ambiguous width unicode symbols conflicting between vscode/xterm.js and conpty reprinting the screen. The only solution currently is to remove problem characters from your prompt.

RichardCYC commented 1 year ago

~I encountered the same problem and the duplicated characters showed up when I press tab.~ Found the suggestion here and switching to a theme without icon at the start of the line fixed the issue!

sidewinder12s commented 1 year ago

I think I've also been noticing this in macos & linux vscode instances.

nalinvyas commented 1 year ago

~ Found the suggestion here and switching to a theme without icon at the start of the line fixed the issue!

This didn't fix my issue

saberSakin commented 1 year ago

i have the same problem. I have no themes and no extension installed but still the vscode terminal is doing this.

Tyriar commented 10 months ago

I'm going to close this since it's unfortunately not actionable by us. To clarify the issue:

The recommendation is still to not use ambiguous width characters in your prompt.