Like screen? Wish it was your login shell?

So do I.  And so did I. And being a smart guy, I made it so.

Oh, didn’t I come to regret that decision.  See, if you make screen your login shell (via /etc/passwd or some other mechanism) lots of things stop working.  Like rsync.  Like ssh’ing with a command, rather than for a shell.

Sure, you get a shared screen environment across *all* your logins.  ( Honest, it’s cool.  Open up two different ssh sessions and type in one.  It’s echo’d to both.  Spiffy. )  But now lots of tools have stopped working, and you just can’t deal with it.

With a heavy heart, you set your shell back to bash.  (Yes, bash.  You zsh guys can go now.  Go on. )

Wait!  Don’t give up.  For I, along with the miraculous powers of the interwebs, have a solution.

Muck with your .bashrc file.  Now, I see the lightbulb.  ”I can just replace my .bashrc contents with `screen -R`!! Yay!!!’  No.  Bad user.  Bad bad user.  Naughty things will happen.  Like a screen loop.  Just think it through.

But happily, there’s an easy solution.

Behold!

See, the extra shell variable only kicks the screen process into life once, then the 2nd time ‘round it executes the rest of your .bashrc file.  Oh, make sure this is real near the top.

Win!  Screen goodness that doesn’t break all your servery tools!!!

What’s screen, you ask?  Hey, why didn’t you ask before we started?  Honestly.  Anyways, it’s a “terminal multiplexer.”  Just go here and read about it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s