microsoft / vscode

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

Unexpected space between PowerLine Symbols on Integrated Terminal #193073

Open fluentmoheshwar opened 1 year ago

fluentmoheshwar commented 1 year ago

Type: Bug

  1. Install starship
  2. Use this starship config
    
    format = """
    [](#182C61)\
    $username\
    [](fg:#182C61 bg:#01579B)\
    $directory\
    [](fg:#01579B bg:#16a085)\
    $git_branch\
    $git_status\
    [](fg:#16a085 bg:#1B5E20)\
    $c\
    $python\
    $elixir\
    $elm\
    $golang\
    $gradle\
    $haskell\
    $java\
    $julia\
    $nodejs\
    $nim\
    $rust\
    $scala\
    [](fg:#1B5E20 bg:#2980b9)\
    $docker_context\
    [](fg:#2980b9 bg:#3F51B5)\
    $time\
    [](fg:#3F51B5 bg:#1A237E)\
    $cmd_duration\
    [](fg:#1A237E bg:#2c3e50)\
    $status\
    [ ](fg:#2c3e50)\
    """
    command_timeout = 5000
    scan_timeout = 70

[username] show_always = true style_user = "bg:#182C61" style_root = "bg:#182C61" format = "󰀉 $user " disabled = false

[directory] style = "bg:#01579B" format = " 󰉋 $path " truncation_length = 3 truncation_symbol = "…/"

[c] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[python] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[elixir] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[elm] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[git_branch] symbol = "" style = "bg:#16a085 fg:#000000" format = " $symbol $branch "

[git_status] style = "bg:#16a085 fg:#000000" format = "$all_status$ahead_behind "

[golang] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[gradle] style = "bg:#1B5E20" format = " $symbol ($version) "

[haskell] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[java] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[julia] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[nodejs] symbol = "" style = "bg:#1B5E20" format = " $symbol ($version) "

[nim] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[rust] symbol = "" style = "bg:#1B5E20" format = " $symbol ($version) "

[scala] symbol = " " style = "bg:#1B5E20" format = " $symbol ($version) "

[docker_context] symbol = " " style = "bg:#2980b9" format = " $symbol $context $path"

[time] disabled = false time_format = "%r" # Hour:Minute:Seconds AM/PM Format style = "bg:#3F51B5 fg:#000000" format = " 󰥔 $time "

[cmd_duration] style = "bg:#1A237E" min_time = 500 format = " 󰅒 took: $duration "

[status] style = "bg:#2c3e50" symbol = "💔 " success_symbol = "❤️" format = " $symbol$common_meaning$signal_name$maybe_int " map_symbol = true disabled = false

3. Configure PowerShell to use starship
4. Open PowerShell using Integrated Terminal
5. See Unexpected space between PowerLine Symbols on Integrated Terminal

![image](https://github.com/microsoft/vscode/assets/65463913/372ea386-82a3-4a4b-b438-eb750412bfe4)

VS Code version: Code 1.82.1 (6509174151d557a81c9d0b5f8a5a1e9274db5585, 2023-09-08T08:45:05.575Z)
OS version: Windows_NT x64 10.0.22621
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM)2 Duo CPU     T5870  @ 2.00GHz (2 x 1995)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: disabled_off<br>opengl: enabled_on<br>rasterization: unavailable_off<br>raw_draw: disabled_off_ok<br>video_decode: unavailable_off<br>video_encode: unavailable_off<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: unavailable_off<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|1.93GB (0.27GB free)|
|Process Argv|--disable-extensions --crash-reporter-id 1c4fcefb-ace5-4e79-bc88-877db98ea822|
|Screen Reader|no|
|VM|0%|
</details>Extensions disabled<details>
<summary>A/B Experiments</summary>

vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931:30280409 vshan820:30294714 vstes263:30335439 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vscccc:30803845 2e4cg342:30602488 89544117:30613380 a9j8j154:30646983 showlangstatbar:30737416 962ge761:30835153 03d35959:30757346 pythonfmttext:30731395 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 pythonnosmt12:30797651 pythonidxptcf:30805731 pythonnoceb:30805159 dsvsc013:30795093 dsvsc014:30804076 diffeditorv2:30821572 dsvsc015cf:30829746



</details>

<!-- generated by issue reporter -->
fluentmoheshwar commented 1 year ago

Related issue on starship/starship#5439

fluentmoheshwar commented 1 year ago

I would like to note that Integrated Terminal of Visual Studio Code for Linux works fine.

manuth commented 5 months ago

I was searching for this issue for evenings now - bruh. As mentioned here, this issue occurs on Windows but not on linux.

It might also be worth mentioning that this issue only occurs for characters which have a code point above U+FFFF (i.e. any nerd font glyph which has an ID with more than 4 hexadecimal characters).

Meaning:

The folder icon nf-md-folder with the code point f024b will cause this issue, while the (I believe) similar looking icon nf-fa-folder with code point f07b (take note that it only has 4 characters) won't: image

pfmoore commented 5 months ago

I'm seeing this as well, with Oh-My-Posh. It looks like the integrated terminal is miscalculating the width of a character string like "\udb84\udfab" as 2, rather than 1 (it's the UTF-16 representation of a high bit character).

fluentmoheshwar commented 5 months ago

I'm seeing this as well, with Oh-My-Posh. It looks like the integrated terminal is miscalculating the width of a character string like "\udb84\udfab" as 2, rather than 1 (it's the UTF-16 representation of a high bit character).

So it's indeed a bug for Visual Studio Code not starship or oh-my-posh