VS Code集成终端不显示特殊字符。

5

我的VS Code集成终端无法识别第一张截图中显示的git分支符号或前向箭头字符,但在iTerm窗口和IntelliJ的集成终端中可以正确显示。

这些字符来自iTerm,使用我在此处经历的终端设置步骤:https://medium.com/@Clovis_app/configuration-of-a-beautiful-efficient-terminal-and-prompt-on-osx-in-7-minutes-827c29391961

我想在VS Code集成终端中看到的内容: enter image description here 我目前在VS Code集成终端中看到的内容: enter image description here

我找到了一个解决方法,可以将其添加到我的VS Code settings.json文件中,但由于该设置已作为默认设置集成到较新的vs更新中而被弃用。

"terminal.integrated.experimentalTextureCachingStrategy": "dynamic"

这并不是一个紧迫的问题,但使用特殊字符来个性化VS Code终端与更多git信息和美学将会非常好。


很可能是字体问题。我也对解决方案感兴趣。 - Mike Lischke
1个回答

0
如果您尚未安装powerline/nerdfont字体,请将其安装到系统中,然后在settings.json文件中的terminal.integrated.fontFamily设置中指定该字体。
引用自VS Code文档

Powerline fonts are special patched fonts that contain additional characters that can be used in the terminal. VS Code's terminal renders some of the Powerline symbols without needing to configure a font, but if more glyphs are desired, configure a Powerline font with the font family setting. Powerline fonts typically end in " for Powerline", the following setting is an example of how to configure a DejaVu Sans Mono that has been patched:

"editor.fontFamily": "'DejaVu Sans Mono for Powerline'"

Nerd Fonts work the same and typically have a " NF" suffix, the following is an example of how to configure Hack's nerd fonts variant:

"terminal.integrated.fontFamily": "'Hack NF'"

"terminal.integrated.fontFamily": "Hack Nerd Font Mono" 应该是这样的。 - BangTheBank
@BangTheBank "should be" ... 它将是您在系统上安装并想要使用的任何nerdfont的名称。我只是引用文档,它只是给出了一个在一个系统上安装的字体的名称的示例。 - starball
用户,我的意思是对于Hack NF实际上是指Hack Nerd字体。在终端中,您必须使用Hack Nerd字体单间距版本。您提到的NF后缀并不正确。 - BangTheBank

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接