1、ctrl + shift + p打开palete管理面板
2、搜索setting,找到setting.json,后打开
3、按照以下格式添加如下配置代码,其中args参数列表可以参考Anaconda Powershell Prompt快捷键属性中目标里的内容
注:若是在VSCode中配置cmd,则需要配置"path"参数指定cmd的路径("source"参数默认只支持"PowerShell"与"Git Bash")
{ "terminal.integrated.profiles.windows": { "PowerShell": { "source": "PowerShell", "args": ["-ExecutionPolicy" ,"ByPass", "-NoExit", "-Command","& 'D:\\miniconda3\\shell\\condabin\\conda-hook.ps1'; conda activate 'D:\\miniconda3' "] } }, "terminal.integrated.defaultProfile.windows": "PowerShell" }同理cmd配置:
"terminal.integrated.profiles.windows": { "Command Prompt": { "path": "cmd.exe", "args": ["/K", "D:\\miniconda3\\Scripts\\activate.bat"] } }, "terminal.integrated.defaultProfile.windows": "Command Prompt",