0

I'm having an issue with the appearance of my terminal prompt in VS Code when using Powershell in combination with Starship. The same configuration yields different visual outputs between the native Terminal application and the integrated terminal in VS Code.

Here's the appearance in the Terminal app: terminal

And here it is in VS Code: vscode

You can observe an extra space in the VS Code terminal prompt which is not present in the Terminal app.

Here's my Starship configuration for the prompt:

format = """
[](#E6AB5E)\
$os\
$username\
[](bg:#DA627D fg:#E6AB5E)\
$directory\
[](fg:#DA627D bg:#FCA17D)\
$git_branch\
$git_status\
[](fg:#FCA17D bg:#86BBD8)\
$python\
[](fg:#86BBD8 bg:#06969A)\
$docker_context\
[](fg:#06969A bg:#33658A)\
$time\
[ ](fg:#33658A)\n
$character"""

add_newline = true

[username]
show_always = true
style_user = "bg:#E6AB5E"
style_root = "bg:#E6AB5E"
format = '[ $user ]($style)'

[character]
success_symbol = "[❯](blue)"
error_symbol = "[❯](red)"
vimcmd_symbol = "[❮](green)"

[os]
style = "bg:#E6AB5E"
disabled = false # Disabled by default

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

[git_branch]
symbol = ""
style = "bg:#FCA17D"
format = '[ $symbol $branch ]($style)'

[git_status]
style = "bg:#FCA17D"
format = '[$all_status$ahead_behind ]($style)'

[python]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[time]
disabled = false
time_format = "%R" # Hour:Minute Format
style = "bg:#33658A"
format = '[  $time ]($style)'

[os.symbols]
Windows = " "

I've attempted to diagnose the issue myself:

  • Checked the configuration multiple times for any inconsistencies.
  • Tried other terminal applications like hyper.js, which reproduces the same inconsistency.
  • Confirmed that the configuration displays correctly on macOS.

Despite these attempts, I'm unable to determine the root cause of the discrepancy. Has anyone else faced this issue or does anyone have any suggestions on how to resolve it?

starball
  • 20,030
  • 7
  • 43
  • 238

0 Answers0