Go to the previous, next section.
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.
Command: autodetach state
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
screen and all the processes it contains. Autodetach is
on by default.
(C-a d, C-a C-d)
screen session (disconnect it from the terminal and
put it into the background). A detached
screen can be resumed by
screen with the
-r option. (see section Invoking
Command: password [crypted_pw]
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
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 paste buffer. Default is `none', which disables
Mainly the same as
detach, but also sends a HANGUP signal
to the parent process of
Caution: This will result in a logout if
screen was started from your login shell.
Command: pow_detach_msg [message]
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. Without parameter, the current message is shown.
(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
is started) and is executed with the user's uid and gid.
Warning: When you leave other shells unlocked and have no password set
screen, the lock is void: One could easily re-attach from an
unlocked shell. This feature should rather be called
These commands allow other users to gain access to one single
session. When attaching to a multiuser
screen the sessionname is
username/sessionname to the
-S command line option.
Screen must be compiled with multiuser support to enable features
Switch between single-user and multi-user mode. Standard screen operation is single-user. In multi-user mode the commands
acldel can be used to enable (and disable) other users accessing this
Enable users to fully access this screen session. Usernames can be one user or a comma seperated list of users. This command enables to attach to the
screen session and performs the equivalent of
aclchg usernames +rwx "#?". To add a user with restricted access,
aclchg command below. Multi-user mode only.
Change permissions for a comma seperated list of users. Permission bits are represented as `r', `w' and `x'. Prefixing `+' grants the permission, `-' removes it. The third parameter is a comma seperated list of commands or windows (specified either by number or title). The special list `#' refers to all windows, `?' to all commands. If usernames consists of a single `*', all known users is affected. 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. To withdraw the writelock from another user in e.g. window 2: `aclchg username -w+w 2'. To allow readonly access to the session: `aclchg username -w "#"'. As soon as a user's name is known to screen, he can attach to the session and (per default) has full permissions for all command and windows. Execution permission for the acl commands,
at and others should also be removed or the user may be able
to regain write permission.
Multi-user mode only.
Remove a user from screen's access control list. If currently attached, all the user's displays are detached from the session. He cannot attach again. Multi-user mode only.
Write a message to all displays. The message will appear in the terminal's status line.
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.
Command: defwritelock on|off|auto
Sets the default writelock behaviour for new windows. Initially all windows will be created with automatic writelocks.
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.
environment variable still reflects the old name. This may result in
confusion. The default is constructed from the tty and host names.
(C-a z, C-a C-z)
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.
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.