fix(bash/zsh): Non-interactive login shell wasn't picking ~/.profile

This commit is contained in:
Pratik Tripathy
2025-07-24 16:48:31 +05:30
parent 9306b611b9
commit 43a5671f5d
2 changed files with 6 additions and 2 deletions

View File

@@ -1,7 +1,8 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
[ ! -f "$HOME/.profile" ] || source "$HOME/.profile"
# Sets environment variables for login non-interactive shells (VS Code & Zed)
[ -z "$XDG_CONFIG_HOME" ] && source "$HOME"/profile
# If not running interactively, don't do anything
case $- in
@@ -186,6 +187,6 @@ command -v zoxide >/dev/null && eval "$(zoxide init --cmd cd bash)"
# Source aliases and shell functions
for alias_file in "$XDG_CONFIG_HOME"/shell/*.sh; do source "$alias_file"; done
# TIP: Following should be executed AFTER the aliases are sourced
# TIP: Should be executed AFTER aliases are sourced
command -v op >/dev/null && bind '"^O":"op\n"' # Fuzzyfind projects and open in nvim
command -v pnew >/dev/null && bind '"^[o":"pnew\n"' # Create a new project quickly