starship: Unexpected space between PowerLine Symbols on Visual Studio Code Integrated Terminal
Current Behavior
There is unexpected space between PowerLine Symbols on Visual Studio Code Integrated Terminal. It makes the terminal look ugly.
Expected Behavior
There should be no space between PowerLine Symbols.
Additional context/Screenshots
Environment
- Starship version: 1.16.0
- pwsh version: PowerShell 7.3.6
- Operating system: Windows 10.0.22621
- Terminal emulator: vscode 1.82.1
- Git Commit Hash:
- Branch/Tag: master
- Rust Version: rustc 1.71.0 (8ede3aae2 2023-07-12)
- Rust channel: stable-x86_64-pc-windows-msvc release
- Build Time: 2023-07-30 13:40:31 +00:00
Relevant Shell Configuration
Import-Module PSReadLine
Enable-PowerType
Set-PSReadLineOption -PredictionSource HistoryAndPlugin -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
Import-Module -Name Terminal-Icons
Invoke-Expression (&starship init powershell)
Starship Configuration
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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 26 (1 by maintainers)
Noted, will close after trying m
So, it looks like Conpty of a number of Windows versions is broken. There is a workaround for Windows on
vscodesince version1.93in August 2024: https://code.visualstudio.com/updates/v1_93#_conpty-shipping-in-productSo basically all you need to do is set
"terminal.integrated.experimental.windowsUseConptyDll": trueWith this clearly being contpy and Windows issue, I’d recommend you to close this issue.
Alright - I tested it on Windows Terminal now, too and there is something interesting I found out: Just to keep it in mind: Nerd Font Icons which actually consist of 2 letters (this being icons with code points with a value >
0xffff) cause spaces which are especially irritating in PowerLines.In terms of Windows Terminal…
1.12.10983.0, this error does occur1.20.11781.0, this error does not occurFurthermore, it occurs in
vscodeeditors, but only on Windows. So this has to be an error in the Terminal Emulators rather than prompt engines such as Starship. I think it might make sense to open up an issue in thevscoderepository@fluentmoheshwar any Nerd Font character above
0xffffcauses this issue. The user profile icon you use, for example, namelynf-md-account_circlehas the code point value0xf0009, which is above0x0ffff.If you instead use
nf-fa-circle_user, which has the code point value0xf2bd, you won’t see a space next to the$usernamesection anymore.Consider this a workaround until the issue at hand is fixed.
I still have to find out, whether this is only a VSCode issue or entirely a Windows error (hopefully not, bc I wouldn’t know where to open up an issue, then, lol)
Edit: Similarly, you use
nf-md-folderas your folder icon which has code point value0xf024band the clock iconnf-md-clockwith code point value0xf0954(both >0x0ffff).As a workaround, you would have to swap these icons for other icons with lower code point values, too.
You can btw look up the icon names and their code point values on the nerdfont cheatsheet, too: Nerd Fonts Cheat Sheet
Keep in mind, though that characters above
0xffffare still not rendered properly as mentioned.Changing the OS character fixed it for me.
Using the
nf-md-archcharacter (f08c7):Using the
nf-linux-archlinuxcharacter (f303):Pick yours from the Nerd Fonts Cheat Sheet.
I don’t think it’s shell specific. I have seen same issue with zsh on windows
Ouch - I remember also once having this problem and having it vanish when re-opening the terminal. Although, I do not remember whether it also involved
fish- I do remember running Windows back then.But just to make sure that you can reproduce the issue in the same way that we do. Could you please install the theme posted by @fluentmoheshwar and:
pwshterminal in vscode installed on Windowspwsh.exein a WSL terminal inside vscodepwsh.exeinside itBecause all of them let me 100% reproduce this error