.bashrc/.profile 没有加载到新的 tmux 会话(或窗口)上——为什么? [英] .bashrc/.profile is not loaded on new tmux session (or window) -- why?
问题描述
当 tmux 启动或打开一个新窗口时,它不会加载我的 .profile
或 .bashrc
.我最终输入了 .~/.bashrc
每次.有没有办法让它自动发生?
是的,在你的 .bash_profile
末尾,放一行:
这会在通常只处理配置文件的情况下自动获取 rc 文件.
bash
何时运行某些文件的规则很复杂,取决于正在启动的 shell 的类型(登录/非登录、交互与否等),以及命令行参数和环境变量.
您可以在 man bash
输出中看到它们,只需查找 INVOCATION
- 您可能需要一些时间来消化和解码它:-)>
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 way to make this happen automatically?
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 :-)
这篇关于.bashrc/.profile 没有加载到新的 tmux 会话(或窗口)上——为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!