check if bashrc exists before running it (#170870)

* fix #170868

* Update src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
This commit is contained in:
Megan Rogge 2023-01-09 09:18:22 -08:00 committed by GitHub
parent 9df499d09b
commit 408fc00570
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,9 @@ VSCODE_SHELL_INTEGRATION=1
# Run relevant rc/profile only if shell integration has been injected, not when run manually
if [ "$VSCODE_INJECTION" == "1" ]; then
if [ -z "$VSCODE_SHELL_LOGIN" ]; then
. ~/.bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
else
# Imitate -l because --init-file doesn't support it:
# run the first of these files that exists