VS Code终端搭配PowerShell与Starship时提示符间距不一致问题
VS Code集成终端与原生Terminal中Starship提示符显示不一致问题
我在VS Code中使用PowerShell搭配Starship时遇到终端提示符显示异常:相同配置下,VS Code集成终端与系统原生Terminal应用的提示符视觉效果不一致。
原生Terminal应用显示效果:
VS Code显示效果:
可见VS Code终端提示符比原生终端多了一个空格。
我的Starship提示符配置如下:
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 = " "
我已自行排查:
- 多次检查配置,未发现不一致项;
- 测试hyper.js等终端,仍存在该问题;
- 确认配置在macOS上显示正常。
目前仍无法确定问题根源,求问是否有同类问题案例或解决建议?
内容的提问来源于stack exchange,提问作者Robin Reiners
相关产品推荐
相关产品推荐

