SCREEN - the terminal multiplexer

SCREEN is a "window manager" for the console and terminals.


SCREEN - description on the GNU page

Mind you, the following is the technical explanation taken from the official homepage on gnu.org. If you want a less technical explanation then read the text below.

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

Each virtual terminal provides the functions of the DEC VT100 terminal and, in addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO 2022 standards (e.g., insert/delete line and support for multiple character sets).

There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows the user to move text regions between windows.

When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would.

Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill the current window, view a list of the active windows, turn output logging on and off,copy text between windows, view the scrollback history, switch between windows, etc.

All windows run their programs completely independent of each other. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the users terminal.


What does SCREEN do?

SCREEN explained by Sven

SCREEN allows you to switch between programs and yet use just only one "terminal". So you can write texts, look at emails and newsgroups, read webpages, download files, all at the same time - but with a window for each program.

SCREEN shows one window at a time - all other windows are hidden. And if you need to see several programs in the same terminal windows, well, there's the "split" command which lets you split the terminal into several horizontal subwindows:

.___________________________________________________.
| Editor                                            |
| ...                                               |
|---------------------------------------------------|
| Email                                             |
| ...                                               |
|---------------------------------------------------|
| News                                              |
| ...                                               |
|---------------------------------------------------|
| Shell                                             |
| ...                                               |
|---------------------------------------------------|
| Webbrowser                                        |
| ...                                               |
`___________________________________________________'

SCREEN can permanently show a list of window numbers and their titles in the last line of the terminal. This line can also include other information, eg the hostname, the date or current time. And now that there is the "backtick" command you can use the result of some command or script in the display, too.

SCREEN allows to create a copy of the screen's display (hardcopy) so you can easily send bug reports about programs and their output on screen.

SCREEN can also keep a logfile for each window so you can monitor programs and their output.

SCREEN gives you digraph input so you can enter special characters by a combination of two normal characters even when you do not have a suitable keyboard. This adds input of special characters for all programs running inside SCREEN without having them adjusted.

SCREEN is actually two processes - one which attaches (connects) it to a terminal, and another one to keep the programs inside it alive. This means you can detach the session (disconnects from the terminal) and log out while the second process keep the programs inside alive. So when you log in again you can reattach to your SCREEN session. This means you can quickly log out without having to close all processes, and after you log in you can start right away where you have left off without having to restart all your programs.

SCREEN also has a lockscreen built-in so you can quickly lock your terminal while you get some more pizza and coke. No need to log off here - just enter your password and continue. And if you do not trust "root" to change your password to get at your screen session then you can set a password which only works for your screen session.

SCREEN has a copy mode which allows to copy text from one windows and paste it into another windows - think of "clipboard". Each window has a backlog for scrolled off lines which can be accessed for copying, too. You can select text between two positions like with the mouse (hey - no more use of mouse!) and also select text of a rectangle between those two positions. The selected text can be joined to a big line before copying, and you can stuff the copied text right into a temporary file. The temporary file can be made available to other users on the system, too, so they can slurp the contents into their own session's copy buffer with a simple command which makes it easy to exchange data without having to send it via email. All commands a in vi style, so if you know the basics of vi then you should get familiar with this pretty fast.

SCREEN can monitor the invisible windows for action or silence and inform you about it. Very useful eg with chatting (something is happening again) or compile sessions, where silence indicates that the compilation has finished.

SCREEN let you set (read/write) permissions for other users so other people can watch your session or can even write to your processes and thus you can use SCREEN for collaboration on some work. Admins can see what their users are typing and therefore help them out much better. No more questions on the phone like "did you type that now? and now what happened?"

There is no GUI required - you simply have to have a connection to a machine which has SCREEN installed.

SCREEN has free key binding and is Free Software! :-)

SCREEN works on a simple "telnet" session - but we recommend using terminal emulators which make use of encrypted data transmission, using the ssh protocol.

SCREEN runs on almost all kinds of Unix; BeOS, HP/UX, IRIX, MacOS, and, of course, on FreeBSD and Linux.

SCREEN is Free Software! :-)

Window Multiplexing
SCREEN allows you to switch between several windows, each running its own program. This allows you to use several programs at the same time, such as a mailer, a newsreader, a webbrowser, an editor, and a shell. All of this on the same terminal - no more required.
Using only one terminal is also nice as you can share the console windows on the same FreeBSD or Linux machine with others. One console window for each user - that's all you need. And there is no need to remember which consoles are taken and which ones you still need to log out from. ;-) Furthermore, you only need to lock your console once to lock your whole SCREEN session. (see below)

Window Backlog, Hardcopy and Logging
SCREEN allows you to make a hardcopy of a window (aka "screen shot"), and it automatically saves everything that "scrolls off" your windows into a "backlog" (the length is configurable in the setup file). SCREEN also allows keep a "logfile" for a window which is very useful for programs that do not have a logfile feature.

Copy&Paste
SCREEN gives you "copy&paste", ie commands to copy text from a window and its backlog; the copied text can then be pasted into another window or into a temporary file for exchange with programs and user of SCREEN.

Key Binding
SCREEN lets you "bind" keys to commands to abbreviate tasks.

Session Detaching and Reattaching
SCREEN lets you "detach" a session, ie ite keeps running without a terminal.
Usually programs that send their output to a terminal will die as soon as the (connection to the) terminal is gone. But when SCREEN is detached the started programs will keep on running. This allows you to keep programs running while you are away (ie you log out, abandoning your terminal). No need to start all the programs again - just reattach to your (running) SCREEN session! So whether you lose your connection to the host running your SCREEN session by accident or whether you detach your session and log off - as soon as you reattach to your session you can continue your work.

Session Locking
You can "lock" your session so that others cannot use it. You can either use the built-in lock program or select your own one. For the built-in lock program you can either have the lock unlocked with your current password on that machine or you can set a separate password for SCREEN sessions only by adding a (crypted) one to your setup file. (see below)
Useful if you just leave the computer console for a short time, eg when you leave the room to get a printout or when get yourself something a drink, or when you need to get rid of just those. ;-)

Summary: Start SCREEN before starting any other commands. It'll be well worth it.


Why upgrade?

Whenever users send their questions onto the mailing list they usually forget to state the version number of their installation of SCREEN. And every so often we learn that they were having trouble with an old version which often go away when upgrading to the latest version.

But telling everyone to upgrade for the heck of it obviously is not good enough. Users want *reasons*. And they want to see new features.

OK - new features probably are the best reason to upgrade (apart from bug fixes, of course). So - here is a small list of features which may interest you. (see file patchlevel.h for more info).

3.09.09 new string escape: "%{...}" for changing attributes and color.
        new commands: readbuf, writebuf.
        added support for utf8 and 16 colors.
        change: digraph input allows input of hex value (eg "0x40").
3.09.11 new commands:
        - eval:       evaluate a sequence of screen commands (command chaining).
        - source:     reload config file with ":source filename"
        - windowlist: shows menu of windows, allows switching.
        new string escapes: eg flags, focus, hfill, hostname.
        change:       added support for 256 colors.
3.09.15 new command: backtick
4.00.00 new command: idle
        allows to call a screenblanker automatically
        after N seconds of idle time.  see Sven's setupfile for examples.