我在Visual Studio 代码上打开了集成终端,但我不喜欢它默认的编辑器字体值。我想把它改成Meslo Regular Z Powerline
. 要点是:当我输入这个值"Meslo Regular Z Powerline"
时,结果发现 Visual Studio 代码无法识别它。我认为问题在于它包含的空格字符。我已将它安装在我的 Mac 上,但它仍然无法识别它。解决方法是什么?
10 回答
我看到我使用的名称不是正确的名称:这里是正确的名称 “Meslo LG M DZ for Powerline”
"terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline"
这个工作得很好
在 Ubuntu 18.04 中,答案中的任何内容都不适合我,它一直在抱怨以下消息:
终端仅支持等宽字体。
所以我挖了一下,这是我的解决方案:
无需在 Ubuntu 18.04 中添加额外的字体来解决此问题,我们只需在 vscode 中添加缺少的电力线字体即可正确显示符号。
所以我只是添加到我的设置中:
{
...
"terminal.integrated.fontFamily": "monospace, PowerlineSymbols",
...
}
一切都很顺利,我可以看到我的带有电力线的 VSCode 终端,就像普通的 OS 终端一样。
干杯!
从这里安装以下字体
在中打开设置vs code
>Preferences: Open Settings (JSON)
在中添加以下行settings.json
"terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline"
Mac用户版本:
"terminal.external.linuxExec": "iterm",
"terminal.external.osxExec": "Iterm.app",
"terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline",
只需找到安装字体的 Meslo*.ttf 文件,然后在系统安装程序中检查字体的实际名称。然后将该名称复制到 vscode 设置。
更新了 iTerm2 和 VS Code 1.41.1 的修复程序
从您的 iTerm2 设置(iTerm2/Preferences/Profiles/Text)复制确切的字体在我的情况下,字体是“Meslo LG M for Powerline”
然后在 VS 代码字体设置(代码/首选项/设置/文本编辑器/字体)中将字体添加到字体系列。
我的字体系列最初设置为:“Menlo, Monaco, 'Courier New', monospace” 只需将您的 iTerm 字体添加到末尾,如下所示:
“Menlo, Monaco, 'Courier New', monospace, Meslo LG M for Powerline”
这是我在 vcode 中使用 Powerline 对鱼终端的设置
"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",