Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 "
share|improve this question
    
I solved this problem by moving all the contents of ~/.bash_profile to ~/.bashrc. Apparently screen invokes ~/.bashrc before each window. –  Nadal May 6 '10 at 21:22
add comment

migrated from stackoverflow.com Oct 6 '11 at 8:48

This question came from our site for professional and enthusiast programmers.

4 Answers

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.

share|improve this answer
add comment

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
share|improve this answer
add comment

add shell -$SHELL in the ~/.screenrc works for me. It will make every screen session as a nornal shell session.

share|improve this answer
    
This worked for me as well. Thanks! –  CamelBlues Nov 20 '11 at 16:45
add comment

The problem is a little vague; shell startup files are run by screen upon creation of windows, that yours aren't feels like something is misconfigured in your .bashrc or .bash_profile. I haven't run into this using screen on OS X.

Have you tried iTerm instead of screen? I use it exclusively on my Mac and then use screen on the servers I admin.

share|improve this answer
    
thanks. see the comments I posted to my question. –  Nadal May 6 '10 at 21:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.