我在 Visual Studio Code 上打开了集成终端,我不喜欢它默认的编辑器字体值。我想把它改成
Meslo Regular Z Powerline
。
要点如下:当我输入这个值"Meslo Regular Z Powerline"
时,结果发现 Visual Studio Code 无法识别它。我认为问题是因为它包含空格字符。我已将其安装在 Mac 上,但仍然无法识别。
有什么解决方法吗?
我发现我使用的名称不是正确的名称:这是正确的名称 “适用于电力线的 Meslo LG M DZ”
"terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline"
这个效果很好
在 Ubuntu 18.04 中,答案中的所有内容都不适合我,它一直抱怨以下消息:
终端仅支持等宽字体。
所以我挖掘了一下,这就是我的解决方案:
无需在 Ubuntu 18.04 中添加额外的字体来解决此问题,我们只需在 vscode 中添加缺少的 powerline 字体即可正确显示符号。
所以我只是添加到我的设置中:
{
...
"terminal.integrated.fontFamily": "monospace, PowerlineSymbols",
...
}
一切都很好很顺利,我可以看到带有电源线的 VSCode 终端,就像常规操作系统终端一样。
干杯!
Mac用户版本:
"terminal.external.linuxExec": "iterm",
"terminal.external.osxExec": "Iterm.app",
"terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline",
从这里安装以下字体
在
vs code
中打开设置
>Preferences: Open Settings (JSON)
在
settings.json
中添加以下行
"terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline"
当我在 Linux mint 中使用带有 powerLevel10k 的 OhMyZsh 时,我必须使用
MesloLGS NF Regular
字体配置我的 zsh shell。
但是我的 VS Code 终端仍然不支持 powerlevel10k 主题。
经过几个小时的反复试验,我发现它应该是
MesloLGS NF
而不是MesloLGS NF Regular
。
terminal.font
Terminal > Integrated: Font Family
下粘贴:MesloLGS NF
只需找到安装字体的 Meslo*.ttf 文件,然后在系统安装程序中检查字体的实际名称: 然后将该名称复制到 vscode 设置中。
这是我使用 Powerline 在 vcode 内对鱼终端的设置
"terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline",
"terminal.integrated.shell.osx": "/usr/local/bin/fish",
"terminal.integrated.shell.linux": "/usr/local/bin/fish",
更新了 iTerm2 和 VS Code 1.41.1 的修复
从 iTerm2 设置(iTerm2/首选项/配置文件/文本)复制确切的字体 就我而言,字体是“Meslo LG M for Powerline”
然后在VS代码字体设置(代码/首选项/设置/文本编辑器/字体) 将字体添加到字体系列。
我的字体系列最初设置为:“Menlo、Monaco、‘Courier New’、等宽字体” 只需将您的 iTerm 字体添加到末尾,如下所示:
“门洛,摩纳哥,‘Courier New’,等宽字体,Meslo LG M for Powerline”
这些都不适合我..终于找到了:
"editor.fontFamily": "'MesloLGS NF', Courier, Menlo, Monaco, 'Courier New', monospace"
留下其他字体作为如何链接它们的示例。
在我的 vscode 上,我正在使用
"terminal.integrated.fontFamily": "MesloLGS Nerd Font",
。我的字体是通过 pacman 安装的。