What I am doing here is a little scary :) .

About screen in general

with screen I can open multiple windows at once.

$ whatis screen
screen (1)           - screen manager with VT100/ANSI terminal emulation

I would just simply say it is a terminal multiplexer. If you never used it (then you should!).

Nothing new here you could say if you are already a screen user, but maybe there is ;-) .
I am running screen inside a screen!

Multiple screens (the ones inside)

Which basically means I have:

  • screen1 for my mailing (mutt), irc (irssi), twitter (TTYter), my rt poller script
  • screen2 for my local shell, a local root shell, other stuff, an ssh shell on this server
  • screen3 for my some legacy servers and main infrastructure (like dns, backup)
  • screen4 more servers
  • screen5 management host ...

actually I have 8 of these.

Master screen

To make it easy to switch between them I open all the screens from another master screen. To switch between the master screen's windows I have a metakey CTRL-t, on the inside screen it is the default CTRL-a.

I see the titles of the windows on the last line (this is permanent) the line before the last changes as I change windows in the master screen.

my screen setup

If I am sitting in from of my work machine or I login remotely with ssh / mosh I use the same screen command to get my ready to use environment.

The only annoyance is that if you try to attach your screen inside the screen boom! apocalypse now! all your screens are destroyed all the sudden. Screen actually detects this and prevent you from doing that. Except if you are attaching the master screen inside a normal screen. (No one would ever do that, right? :)) )

So I rolled out my own solution:

alias master='[ "$MASTER_SCREEN" -ne "1" ] && export MASTER_SCREEN=1 && screen -e^tT -D -RR master'

I will issue


instead of

screen -D -RR master

from now on which has this protection (against my fast fingers and slow brain).
I am also using the zshrc files from the GRML guys which is great, but on the other hand it makes it very easy to make this kind of mistake as it is very powerful because it makes me fast and efficient.