I'm working in vscode, and I want to build the chromium in tasks.json, but the build shell report error command not found
. I use echo $PATH to see the environments variables in tasks.json. It seems like the build shell in vscode doesn't execute source ~/.bashrc
, so it can't find environment variable, but the terminal in vscode is in working order. Could someone help me?
I had the same issue and fixed it with the solution below
Solution For OSX with ZSH
Add a new file under /usr/local/bin/zsh-with-rc
#!/usr/bin/env zsh
source ~/.zshrc
/bin/zsh $@
Then run
chmod +x /usr/local/bin/zsh-with-rc
In settings.json
add:
"terminal.integrated.automationProfile.osx": {
"path": "/usr/local/bin/zsh-with-rc",
}
Solution For Linux With Bash
Add a new file under /usr/local/bin/bash-with-profile
#!/usr/bin/env bash
source ~/.bash_profile
source ~/.bashrc
/bin/bash $@
Then run
chmod +x /usr/local/bin/bash-with-profile
In settings.json
add:
"terminal.integrated.automationProfile.linux": {
"path": "/usr/local/bin/bash-with-profile",
}
"command": "echo hello"
doesn't show any output, but without this setting it correctly prints 'hello'. I'm on Linux with Bash. –
Toleration Just like @Narek I had to create an automation profile. However the Linux version is:
"terminal.integrated.automationShell.linux": "/usr/local/bin/zsh-with-rc",
It is most definitely a bug because for me, my build tasks were working fine, until suddenly some build tasks failed, while others were still working (EVEN THOUGH invoking the same command). This might be since the most recent update (1.79.2)
For me it was catkin_make
.
Add "terminal.integrated.shell.linux": "/bin/bash" in settings.json
Just use .zshenv
to set your PATH
variables. .zshenv
is always sourced while .zshrc
is sourced only for interactive shells. You can check Z-Shell's User's Guide for more info.
© 2022 - 2024 — McMap. All rights reserved.
-l
such as"path": "/usr/local/bin/bash", "args": ["-l"]
which according to this should load your.bashrc
. Have you tried that or is it set? – Adulterant