Screen

GNU Screen is a program that enables the user to create sessions and have several virtual consoles.

Installation
Full-screen window manager that multiplexes physical terminals between several processes. is available on Gentoo Linux and supports the following useflags


 * debug = Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see http://www.gentoo.org/proj/en/qa/backtraces.xml
 * multiuser = Enable multiuser support (by setting correct permissions)
 * nethack = Express error messages in nethack style
 * pam = Adds support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip

You can install Screen using the following command:

The configuration files are located in

Screen Configuration Files

Usage
General usage of Screen

Start Session
Screen can be started with the following command:

Once started is will create a socket for the session in /var/run/screen/S- You can use any key combination within the session except of + which initiates the Command-Mode. Give the session a reasonable name on startup:

Start a command in a screen session without attaching to it (like a daemon):

Commands
In Command Mode (+) the following key combinations can be used:
 * = create another terminal
 * = switch to the next terminal
 * = detach from the current session

Resume Session
After the session is detached, all the active terminals remain active and so do commands that didn't finish yet. To list existing sessions:

To resume this session:

Session within Session Recursion
You can use a Screen within a Screen session. This occurs when you connect to a another host's Screen session from within your Screen session.

To use the Meta key for the secondary (remote) Screen session, you issue it twice to signal the second Session.


 * + = Your normal meta key usage on your local screen
 * + = Signals the second (remote) Session
 * + = Signal the third (remote) Session
 * + = Signal the fourth (remote) Session, and so on

Some tend to remap the Meta key on remote terminals so they don't have to count. However, if you use the console/terminal often, there tends to be a shortage of keys on the keyboard.

Hardstatus Customization
Customizing the status line, or hardstatus line in GNU Screen terminology is quite common. The following will get you started.

Screenshot of what my hardstatus line looks like using the above hardstatus incantation, along with nine additional terminal titles (ie. screen -t bash 7 bash --noprofile") defined within the .screenrc file.  Each terminal gives me Calendar (calcurse), HTop (htop), startx (manual startx/DWM WM), Root (su), WWW (elinks), EMail (mutt) and a multitude of additional (bash) shells for working in.  (This screenshot unfortunately omits color.)

TTY Autologin with a GNU Screen Session
The following will allow your system to auto login as your user, and automatically initiate a GNU Screen session on tty2. A good scenario for this; You're off the network, secluded from society, and you find entering a password is a bit redundant. The following demonstrates using the BASH Shell.

MinGetty will give you autologin capability along without having to use a password.

Comment-out the second TTY (ie. c2, or terminal number of your choosing) and add mingetty with autologin capability.

Replace the above "USER_NAME" with your login name!

At this point, your system can now auto login on TTY2 with your default shell. Assuming you're using the BASH shell, you can start GNU Screen automatically by adding the "screen" command to your $HOME/.bash_profile file. This file is executed automatically when you first login. (Make sure you start any subsequent BASH shells using the "bash --no-profile" switch, including shells started within the $HOME/.screenrc files!)

Links
gnu.org screen page