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

前端 未结 6 1762
轻奢々
轻奢々 2020-12-12 23:17

When tmux starts or opens a new window, it does not load my .profile or .bashrc. I end up typing . ~/.bashrc every time. Is there a

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 00:06

    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 :-)

提交回复
热议问题