VSCode Integrated Terminal Doesn't Load .bashrc or .bash_profile
·
Answer a question
I have the following files to handle shell configuration:
#~/.bash_profile
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
and
#~/.bashrc
... configure shell
If I open VSCode from the command line using code, my .bashrc is loaded whenever I add a new instance of the integrated shell.
However if I open VSCode via its icon, only my .profile is loaded.
How can I ensure my .bashrc is loaded instead?
I've tried various settings for the terminal.integrated.shellArgs.osx setting without any luck.
Answers
Simply add shell arguments to the VsCode settings.json file.
Paths to the settings.json file are as follows:
Windows: C:\Users\<username>\AppData\Roaming\Code\User\settings.json`
Linux: $HOME/.config/Code/User/settings.json
Mac: $HOME/Library/Application\ Support/Code/User/settings.json
Add one of the following:
"terminal.integrated.shellArgs.windows": ["-l"],
"terminal.integrated.shellArgs.linux": ["-l"],
"terminal.integrated.shellArgs.osx": ["-l"],
This will launch your shell of choice with the login argument. This will thus execute any user profile that is setup.
更多推荐
所有评论(0)