My favorite way to run screen

First, make sure you have screen installed:

$ sudo apt-get install screen

Then, create a .screenrc file with the following in it:

screen -t root sudo su -
screen -t bash2
screen -t bash3

select 0
startup_message off

caption always "%{= kw}%-w%{= bw}%n %t%{-}%+w %-= @%H - %c - (%l)"
#
# Call via:  screen -R -e^Hh -d
#
# to change the strings, look at:
# http://www.gnu.org/software/screen/manual/screen.html#String-Escapes
#
# to test your changes, you can either copy the above line, the do
# CTRL-H :  and then paste in the line above
#
# or, CTRL-H :source ~/.screenrc

Lastly, start up screen:

screen -R -e^Hh -d

This let’s you switch screens by pressing CTRL-H and then SPACEBAR. (I found that I use CTRL-A far too much to let that be the standard screen key binding)

Leave a Reply

Your email address will not be published. Required fields are marked *