I realized a while ago that I wanted to invoke my shell as a login shell when starting screen. This of course gives me immediate access to things in my .profile like aliases, etc.
shell -bashEverywhere I read said to put that in your .screenrc file. On my Mac, OS X 10.5, however it seemed to have the (extremely) unwanted circumstance of changing my cwd whenever I started screen to my $HOME folder.
I was able to do some testing my remoting into a *fairly* vanilla fedora box and running the command:
cd /; screen -s -bash
This started bash as a login shell
shopt login_shell #=> login_shell on
but did not change my cwd.
I tried moving my .profile file to see if it was the culprit.
I finally came up with this hackish solution.
create file
screen_shell
and place in it the line
$SHELL -l
I knew from other testing that
shell 'bash -l'didn’t work, course, now, having remembered that I had a similar experience with vi… I wonder if
shell bash\ -l
would work… (nope…)
so, I then changed my .screenrc file to read
shell /Users/bhenderson/.screen_shell
made sure that I did a
chmod u+x ~/.screen_shell
and off I went.
If anyone would like to add to my understanding of what was going on, or a better solution, please feel free to comment. thanks.

2 Comments
Most shells run as a login shell when you create an alias to it with a minus in front of it. In my case I had the same trouble with ksh which I had to install in my home directory.
It’s installed in ~/sfw/bin/ksh, to make it start as a login shell under screen I created a softlink like so;
cd ~/sfw/bin && ln -s ksh -ksh
and then used ’shell -$SHELL’ in my .screenrc et voila.
Thanks Axel, I also learned the other day that you can change the CWD anytime in screen by typing `chdir‘ at the command prompt ( C-a : )