Tag Archives: screen screenrc sessions

My favorite way to run screen

First, make sure you have screen installed:

[bash]
$ sudo apt-get install screen
[/bash]

Then, create a .screenrc file with the following in it:
[bash]
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
[/bash]

Lastly, start up screen:
[bash]
screen -R -e^Hh -d
[/bash]

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)