当我在GNU屏幕上打开一个新窗口时,它运行.bashrc而不是.bash_profile 。 在我的设置中,这会导致一些环境variables没有在该窗口中正确设置。
我怎么能告诉GNU屏幕总是运行.bash_profile而不是.bashrc打开一个新窗口? (请不要告诉我只从我的.bashrc调用.bash_profile 🙂
你想开始bash(或任何shell)作为loginshell。 你这样做
shell -$SHELL
在你的~/.screenrc 。 神奇的是-在炮弹之前。 有关详细信息,请参阅man screenrc 。 (好吧,没有更多的细节,因为这是非常多的。)
你可能需要从~/.bashrc ~/.bash_profile ,或者把你需要的东西直接放到~/.bashrc或者把这些文件放在第三个文件中,然后从~/.bashrc和~/.bash_profile 。