You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

已部署WSL2/oh-my-zsh/Starship,如何配置VSCode终端Nerd Font图标?

排查VSCode终端Starship显示异常的遗漏配置点

1. 确认VSCode终端字体配置

打开VSCode设置(快捷键Ctrl+,),搜索Terminal > Integrated: Font Family,确保值设置为Hack Nerd Font(注意名称要和系统中安装的字体完全匹配,部分版本可能是HackNerdFont无空格,可在Windows字体设置里确认准确名称)。

2. 检查Zsh配置中Starship的加载命令

打开~/.zshrc文件,确认末尾是否添加了启动Starship的代码:

eval "$(starship init zsh)"

如果缺失,添加后执行source ~/.zshrc使配置生效。

3. 同步WSL侧终端字体设置

确保WSL关联的默认终端(如Windows Terminal)也设置为Hack Nerd Font,避免跨环境的字符渲染冲突。

4. 验证Starship配置文件的有效性

检查~/.config/starship.toml是否存在语法错误,或未启用目标样式依赖的模块。可先重置配置到 nerd-font 兼容预设:

starship preset nerd-font-symbols -o ~/.config/starship.toml

再逐步调整到目标样式。

5. 切换VSCode终端渲染器类型

在VSCode设置中搜索Terminal > Integrated: Renderer Type,尝试切换为dom或canvas,部分环境下渲染器类型会影响特殊符号的显示效果。

内容的提问来源于stack exchange,提问作者SeyyedKhandon

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 00:45:34