【发布时间】:2015-07-09 13:10:33
【问题描述】:
我想更改 Visual Studio Code for Mac 使用的默认终端应用程序。我认为这是偏好或设置 json 的一部分,但不确定。
【问题讨论】:
-
请看答案2
标签: terminal iterm2 visual-studio-code
我想更改 Visual Studio Code for Mac 使用的默认终端应用程序。我认为这是偏好或设置 json 的一部分,但不确定。
【问题讨论】:
标签: terminal iterm2 visual-studio-code
对于那些想要更改默认集成终端不仅仅是外部,并添加custom themes,显示您在哪个git branch,以及文件是否需要@987654329 @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"(注意:从技术上讲,您可以更改有关终端提示的所有内容,但为了保持简短和简单,我们只编辑了用户名部分)
【讨论】:
prompt_segment black default "%(!.%{%F{yellow}%}.)"$'\u26a1'
【讨论】:
iTerm2.app使用iTerm2的人吗?
我知道已经很晚了,但是你可以通过运行命令来更改它
Terminal: Select Default Shell
简单多了
【讨论】:
来自 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"
【讨论】:
没有。但是你可以在这里为这个功能投票:https://visualstudio.uservoice.com/forums/293070-visual-studio-code
【讨论】:
"terminal.external.osxExec": "iTerm.app"