我想更改Visual Studio Code for Mac使用的默认终端应用程序。我认为它是偏好或设置json的一部分,但不确定。
不,但你可以在这里投票支持这个功能:https://visualstudio.uservoice.com/forums/293070-visual-studio-code
对于那些想要更改默认集成终端而不仅仅是外部的人,并添加custom themes
,显示你所在的git branch
,以及文件是否需要是staged or committed
for example。
确保安装了以下内容:
安装powerline font
(我正在使用Menlo,这是一个很好看和非常受欢迎的字体)。
去here并点击
download
打开文件
点击
install font
(注意:如果没有这个,vscode集成终端将无法正确渲染主题)
运行以下命令打开.zshrc文件:
cd〜;代码.zshrc
将iTerm的主题更改为agnoster
:
按
⌘f
打开.zshrc文件中的搜索输入
ZSH_THEME
搜索直到找到实时代码,而不是注释掉的代码:)
编辑代码使它看起来像
ZSH_THEME="agnoster"
保存文件
使用快捷方式打开vscode设置:
⌘,
在vscode设置中,您将看到两个面板。在右侧面板上粘贴:
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "Menlo for Powerline"
假设之前设置为空,现在应该如下所示:
{
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "Menlo for Powerline"
}
完了!享受您的新冰终端
如果您希望提示显示除用户名之外的其他内容,例如雷电,例如mine或anything you want
运行此命令打开agnoster主题:
cd ~/.oh-my-zsh/themes/ ; code agnoster.zsh-theme
按下打开搜索:
⌘f
将其粘贴到搜索栏中:
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m"
要更改提示显示的内容,请仅编辑此部分:
$USER@%m
请勿更改此部分:
prompt_segment black default "%(!.%{%F{yellow}%}.)
总之,代码现在看起来像这样:
prompt_segment black default "%(!.%{%F{yellow}%}.) Insert here whatever your heart desires"
(注意:从技术上讲,您可以更改有关终端提示的所有内容,但为了保持简短,我们只编辑了用户名部分)
来自visual studio代码博客:
// 64-bit cmd it available, otherwise 32-bit
"terminal.integrated.shell.windows":"C:\\Windows\\sysnative\\cmd.exe"
// 64-bit PowerShell if available, otherwise 32-bit
"terminal.integrated.shell.windows":"C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
// Git Bash
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
// Bash on Ubuntu (on Windows)
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"
我知道它已经太晚了,但你可以通过运行命令来改变它
Terminal: Select Default Shell
它更容易