如何告诉 GNU screen 在每个新窗口中运行 .bash_profile?

use*_*474 19 gnu-screen

当我在 GNU 屏幕中打开一个新窗口时,它运行.bashrc但不运行.bash_profile. 在我的设置中,这会导致在该窗口中未正确设置某些环境变量。

如何告诉 GNU screen 始终运行.bash_profile而不是.bashrc打开新窗口?(请不要告诉我只是.bash_profile从我的.bashrc:)

mat*_*tdm 34

您想将 bash(或任何 shell)作为登录 shell 启动。你这样做

shell -$SHELL
Run Code Online (Sandbox Code Playgroud)

在您的~/.screenrc. 神奇的是-前壳。详情请参阅man screenrc。(嗯,没有更多细节,因为差不多就是这样。)