我正在使用vscode,我想在tasks.json中构建铬,但是build报告了错误command not found
。我使用回显$PATH来查看tasks.json中的环境变量。看起来vscode中的build不执行source ~/.bashrc
,所以它找不到环境变量,但是vscode中的终端处于正常工作状态。有人能帮我吗?
发布于 2021-06-16 06:39:28
在terminal.integrated.shell.linux中添加“settings.json”:/bin/bash
发布于 2022-03-01 16:39:28
我也有同样的问题,用下面的解决方案解决了这个问题。
用ZSH解决OSX问题
在/usr/local/bin/zsh-with-rc
下添加一个新文件
#!/usr/bin/env zsh
source ~/.zshrc
/bin/zsh $@
那就跑
chmod +x /usr/local/bin/zsh-with-rc
在settings.json
中添加:
"terminal.integrated.automationProfile.osx": {
"path": "/usr/local/bin/zsh-with-rc",
}
基于Bash的Linux解决方案
在/usr/local/bin/bash-with-profile
下添加一个新文件
#!/usr/bin/env bash
source ~/.bash_profile
source ~/.bashrc
/bin/bash $@
那就跑
chmod +x /usr/local/bin/bash-with-profile
在settings.json
中添加:
"terminal.integrated.automationProfile.linux": {
"path": "/usr/local/bin/bash-with-profile",
}
https://stackoverflow.com/questions/67917307
复制相似问题