Go to the previous, next section.

Session Management Commands

Perhaps the most useful feature of screen is the way it allows the user to move a session between terminals, by detaching and reattaching. This also makes life easier for modem users who have to deal with unexpected loss of carrier.

Detach

Command: autodetach state

(none)
Sets whether screen will automatically detach upon hangup, which saves all your running programs until they are resumed with a screen -r command. When turned off, a hangup signal will terminate screen and all the processes it contains. Autodetach is on by default.

Command: detach

(C-a d, C-a C-d)
Detach the screen session (disconnect it from the terminal and put it into the background). A detached screen can be resumed by invoking screen with the -r option. (see section Invoking Screen)

Command: password [crypted_pw]

(none)
Present a crypted password in your `.screenrc' file and screen will ask for it, whenever someone attempts to resume a detached session. This is useful, if you have privileged programs running under screen and you want to protect your session from reattach attempts by users that managed to assume your uid. (I.e. any superuser.) If no crypted password is specified, screen prompts twice a password and places its encryption in the copybuffer. Default is `none', which disables password checking.

Power Detach

Command: pow_detach

(C-a D)
Mainly the same as detach, but also sends a HANGUP signal to the parent process of screen.
Caution: This will result in a logout if screen was started from your login shell.

Command: pow_detach_msg message

(none)
The message specified here is output whenever a power detach is performed. It may be used as a replacement for a logout message or to reset baud rate, etc.

Lock

Command: lockscreen

(C-a x, C-a C-x)
Call a screenlock program (`/local/bin/lck' or `/usr/bin/lock' or a builtin, if no other is available). Screen does not accept any command keys until this program terminates. Meanwhile processes in the windows may continue, as the windows are in the detached state. The screenlock program may be changed through the environment variable $LOCKPRG (which must be set in the shell from which screen is started) and is executed with the user's uid and gid.

Multiuser Session

These commands allow other users to gain access to one single screen session. When attaching to a multiuser screen the sessionname is specified as username/sessionname to the -S command line option. Screen must be compiled with multiuser support to enable features described here.

Multiuser

Command: multiuser state

(none)
Switch between single-user and multi-user mode. Standard screen operation is single-user. In multi-user mode the commands acladd and acldel can be used to enable (and disable) other users accessing this screen.

Acladd

Command: acladd username

(none)
Enable a user to (fully) access this screen session. Necessary to allow other users to attach to this screen session. Same as aclchg username +rwx "#?". Multi-user mode only.

Aclchg

Command: aclchg username permbits list

(none)
Change a users permissions. Permission bits are represented as `r', `w' and `x'. Prefixing `+' grants the permission, `-' removes it. The third parameter is a komma seperated list of commands or windows (specified either by number or title). The special list `#' refers to all windows, `?' to all commands. A Command can be executed when the user has the `x' bit for it. the user can type input to a window, when he has its `w' bit set and no other user obtains a writelock for this window. Other bits are currently ignored. Multi-user mode only.

Acldel

Command: acldel username

(none)
Remove a user from screens access control list. If currently attached, all the users displays are detached from the session. He cannot attach again. Multi-user mode only.

Wall

Command: wall message ...

(none)
Write a message to all displays. The message will appear in the terminals status line.

Writelock

Command: writelock on|off|auto

(none)
In addition to access control lists, not all users may be able to write to the same window at once. Per default, writelock is in `auto' mode and grants exclusive input permission to the user who is the first to switch to the particular window. When he leaves the window, other users may obtain the writelock (automatically). The writelock of the current window is disabled by the command writelock off. If the user issues the command writelock on he keeps the exclusive write permission while switching to other windows.

Session Name

Command: sessionname [name]

(none)
Rename the current session. Note that for screen -list the name shows up with the process-id prepended. If the argument name is omitted, the name of this session is displayed.
Caution: The $STY environment variable still reflects the old name. This may result in confusion. The default is constructed from the tty and host names.

Suspend

Command: suspend

(C-a z, C-a C-z)
Suspend screen. The windows are in the detached state while screen is suspended. This feature relies on the parent shell being able to do job control.

Quit

Command: quit

(C-a C-\)
Kill all windows and terminate screen. Note that on vt100-style terminals the keys C-4 and C-\ are identical. So be careful not to type C-a C-4 when selecting window no. 4. Use the empty bind command (as in bind "^\") to remove a key binding (see section Key Binding).

Go to the previous, next section.