External Terminal Here
VS code插件,通过快捷键(Windows/Linux: Ctrl+Shift+C,macOS: Cmd+Shift+C)在当前项目路径下打开外部终端。
功能
- 一键启动 — 按快捷键(Windows/Linux:
Ctrl+Shift+C,macOS: Cmd+Shift+C)立即打开外部终端并进入项目目录
- 智能路径 — 优先使用工作区根目录,无工作区时使用当前文件所在目录
- 任意终端 — 内置常见终端快捷选项,也支持完全自定义
安装
- 在 VS Code 扩展面板搜索
External Terminal Here
- 点击安装
- 按
Ctrl+Shift+C 试用
手动安装(vsix)
npm install -g @vscode/vsce
vsce package
然后在扩展面板 → ... → Install from VSIX...
使用
安装后直接按快捷键(Windows/Linux: Ctrl+Shift+C,macOS: Cmd+Shift+C),外部终端会自动打开并定位到项目目录。
设置
在 VS Code 设置中搜索 External Terminal Here 即可找到:
| 配置项 |
类型 |
默认值 |
说明 |
externalTerminalPath.shell |
string |
"auto" |
终端类型(下拉选择) |
externalTerminalPath.customCommand |
string |
"" |
自定义命令(需 shell 选 custom) |
内置终端选项
| 值 |
说明 |
auto |
平台默认(Windows cmd / macOS Terminal / Linux x-terminal-emulator) |
cmd |
Windows 命令提示符 |
powershell |
Windows PowerShell |
wezterm |
WezTerm |
gnome-terminal |
GNOME Terminal |
terminal |
macOS Terminal |
iterm2 |
iTerm2(macOS) |
custom |
使用下方自定义输入框中的命令 |
自定义终端
externalTerminalPath.shell 选 custom
- 在
externalTerminalPath.customCommand 中填入命令,用 {path} 占位目录
| 示例 |
说明 |
alacritty --working-directory {path} |
Alacritty |
wt -d {path} |
Windows Terminal |
kitty --directory {path} |
Kitty |
wezterm start --cwd {path} |
WezTerm |
ghostty --working-directory={path} |
Ghostty |
foot --working-directory={path} |
Foot (Wayland) |
{path} 会被替换为带引号的目录路径,无需手动加引号。
快捷键
| 平台 |
快捷键 |
| Windows |
Ctrl+Shift+C |
| macOS |
Cmd+Shift+C |
| Linux |
Ctrl+Shift+C |
自定义快捷键
如需修改快捷键,在 keybindings.json 中添加:
{
"key": "ctrl+shift+t",
"command": "extension.openExternalTerminalWithPath"
}
环境要求
VS Code ^1.85.0
许可
MIT
| |