Use GNU screen as login "shell"

One way is:

# if $STY is not set...
if [ -z "$STY" ]; then
    exec screen -ARR
fi

Note that this is written for bash, but should be similar for csh too. Put it to .cshrc to be executed for all shells.


Another way: You can simply set screen as your login shell in /etc/passwd itself, and put this line to your ~/.screenrc: (Fix the path, of course.)

defshell /bin/csh

But this may break programs which run the login shell defined in /etc/passwd for various commands.

(Edit: Don't forget to add screen to /etc/shells)


Old question, but googling for the same thing brought me here so here's a response for anyone else that stumbles onto this page.

Best thing I've found so far is byobu if your distro has it. Comes with an option to run at login and controls multiple screens at once.

You can detach and log out at one location then login to the same session at another location.

I find screen is great to use for running server processes but byobu is great for everyday things.