.bashrc/.profile is not loaded on new tmux session (or window) — why?

Yes, at the end of your .bash_profile, put the line:

. ~/.bashrc

This automatically sources the rc file under those circumstances where it would normally only process the profile.

The rules as to when bash runs certain files are complicated, and depend on the type of shell being started (login/non-login, interactive or not, and so forth), along with command line arguments and environment variables.

You can see them in the man bash output, just look for INVOCATION – you’ll probably need some time to digest and decode it though 🙂

Leave a Comment