This is quick basic intro to GNU Screen.
If you haven’t installed
screen, do so. It rocks.
Start screen. You’ll get a splash screen. Hit space to make it go away.
Depending on your flavour of *nix, you’ll get between 1 and n
screens. First one is numbered 0. Try to switch to screen 1:
1. If you get a message, create screen 1 with
(create). Now you can switch back and forth between 0 and 1 with
Ctrl-a 0 and
Want a “real”
Ctrl-a? (If you’re in Emacs, you do.) Type
Start an editor in one screen, load a file and start editing. Detach
Ctrl-a d (detach). Logout of the shell, then login
again. Attach to the screen:
screen -r (reattach). You should be
back where you left. Continue editing.
Screen is perfect for flaky connections, you’ll be back where you left off even if you get a hangup.
You can use
screen -r -d to cleanly reattach from another session.
If you want a bunch of screens at startup, edit your
~/.screenrc. Mine looks like this:
shell -$SHELL screen -t SHELL0 0 screen -t ROOT 1 screen -t SHELL2 2 screen -t SHELL3 3 screen -t SHELL4 4 screen -t SHELL5 5
The first line starts the current
$SHELL in login mode. The others
set up six windows and gives them titles.
man screen for more info.