命令执行
环境设置
📢 下文以 Windows 环境为例,其他环境参考官方文档 Terminal Shell Integration。
- 设置默认Shell为
Windows PowerShell
- View -> Command Palette... -> Terminal: Select Default Profile
- 进入 VSCode Shell 命令行
- 输入
code $Profile
打开 PowerShell 配置文件 - 输入并保存以下内容
if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --locate-shell-integration-path pwsh)" }