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

Unexpected space between PowerLine Symbols on Integrated Terminal #193073

Closed
fluentmoheshwar opened this issue Sep 14, 2023 · 7 comments
Closed
Assignees
Labels
confirmation-pending terminal-conpty Integrated terminal issues related to the ConPTY backend terminal-rendering upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues

Comments

@fluentmoheshwar
Copy link

fluentmoheshwar commented Sep 14, 2023

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 ]($style)"
disabled = false


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


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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[status]
style = "bg:#2c3e50"
symbol = "💔 "
success_symbol = "❤️"
format = "[ $symbol$common_meaning$signal_name$maybe_int ]($style)"
map_symbol = true
disabled = false
  1. Configure PowerShell to use starship
  2. Open PowerShell using Integrated Terminal
  3. See Unexpected space between PowerLine Symbols on Integrated Terminal

image

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

System Info
Item Value
CPUs Intel(R) Core(TM)2 Duo CPU T5870 @ 2.00GHz (2 x 1995)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: disabled_off
opengl: enabled_on
rasterization: unavailable_off
raw_draw: disabled_off_ok
video_decode: unavailable_off
video_encode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: unavailable_off
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%
Extensions disabled
A/B Experiments
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

@fluentmoheshwar
Copy link
Author

Related issue on starship/starship#5439

@fluentmoheshwar
Copy link
Author

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

@manuth
Copy link
Contributor

manuth commented May 29, 2024

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
Copy link

pfmoore commented Jun 8, 2024

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
Copy link
Author

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

@Tyriar
Copy link
Member

Tyriar commented Dec 10, 2024

This issue seems to originate from an upstream component and is not something VSCode can fix by making a change to our code. As such, I will go ahead and close it. Please try to reproduce in Windows Terminal and report to microsoft/terminal with repro steps.

If you cannot reproduce in Windows Terminal, chances are it's fixed in a later version of Windows. You can read more about how we consume conpty here. Thanks for understanding.

/label upstream terminal-conpty windows

Also we plan on shipping conpty v2 in product soon so these types of problems should go away soon! #224488

@Tyriar Tyriar closed this as completed Dec 10, 2024
@vs-code-engineering vs-code-engineering bot added upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues terminal-conpty Integrated terminal issues related to the ConPTY backend labels Dec 10, 2024
@manuth
Copy link
Contributor

manuth commented Dec 10, 2024

Hi @Tyriar
I tested quite a few versions of Windows Terminal and the error seems to occur on Windows in any Windows Terminal version below 1.20:

starship/starship#5439 (comment)

Is this information of any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmation-pending terminal-conpty Integrated terminal issues related to the ConPTY backend terminal-rendering upstream Issue identified as 'upstream' component related (exists outside of VS Code) windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

5 participants