How to force Gnu screen to load my bash .profile
11,339
Solution 1
shell -$SHELL
Add the above line to your ~/.screenrc
, this will make screen start-up using a login shell which will load your ~/.bash_profile
.
Solution 2
Some Mac applications rely on .bash_profile and some on .bashrc. I have not figured out any particular rule for knowning which one is getting loaded but for consistency this is my .bash_profile:
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
Related videos on Youtube
Author by
Nadal
Updated on September 17, 2022Comments
-
Nadal almost 2 years
I have ~/.bash_profile which I would like to be invoked every single time a new GNU screen is created so that all my aliases work in GNU screen as they work in terminal.
At this time this is what my ~/.screenrc looks like.
hardstatus on hardstatus alwayslastline hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
-
Nadal about 14 yearsI solved this problem by moving all the contents of ~/.bash_profile to ~/.bashrc. Apparently screen invokes ~/.bashrc before each window.
-
-
theonlygusti over 7 yearsThis stops screen starting in the current directory. How do I make screen start in the current directory?