VSCode Integrated Terminal Doesn't Load .bashrc or .bash_profile
bash, settings, shell, visual-studio-code
Solution
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 `-l` (aka `--login`) argument. This will thus execute any user profile that is setup.
Make this shell act as if it had been directly invoked by login... When the shell is not interactive, the login shell startup files will be executed.
Problem
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.