Linux "screen" Command Line Options and Examples
screen manager with VT100/ANSI terminal emulation

Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typi‐ cally interactive shells). Each virtual terminal provides the functions of a DEC VT100 terminal and, in addi‐ tion, several control functions from the ISO 6429 (ECMA 48, ANSI X3.64) and ISO 2022 standards (e.


Usage:

screen [ -options ] [ cmd [ args ] ]
    screen -r [[pid.]tty[.host]]
    screen -r sessionowner/[[pid.]tty[.host]]






Command Line Options:

-c
override the default configuration file from "$HOME/.screenrc" to file.
screen -c ...
-d|-D
does not start screen, but detaches the elsewhere running screen session. It has the same effect as typ‐ing "C-a d" from screen's controlling terminal. -D is the equivalent to the power detach key. If no ses‐sion can be detached, this option is ignored. In combination with the -r/-R option more powerful effectscan be achieved:
screen -d|-D ...
-d
-r Reattach a session and if necessary detach it first.
screen -d ...
-D
-r Reattach a session. If necessary detach and logout remotely first.
screen -D ...
-e
specifies the command character to be x and the character generating a literal command character to y(when typed after the command character). The default is "C-a" and `a', which can be specified as
screen -e ...
-f
turns flow-control on, off, or "automatic switching mode". This can also be defined through the "def‐flow" .screenrc command.
screen -f ...
-h
Specifies the history scrollback buffer to be num lines high.
screen -h ...
-l
turns login mode on or off (for /run/utmp updating). This can also be defined through the "deflogin".screenrc command.
screen -l ...
-list
does not start screen, but prints a list of pid.tty.host strings and creation timestamps identifying yourscreen sessions. Sessions marked `detached' can be resumed with "screen -r". Those marked `attached' arerunning and have a controlling terminal. If the session runs in multiuser mode, it is marked `multi'.Sessions marked as `unreachable' either live on a different host or are `dead'. An unreachable sessionis considered dead, when its name matches either the name of the local host, or the specified parameter,if any. See the -r flag for a description how to construct matches. Sessions marked as `dead' should bethoroughly checked and removed. Ask your system administrator if you are not sure. Remove sessions withthe -wipe option.
screen -list ...
-L
tells screen to turn on automatic output logging for the windows.
screen -L ...
-Logfile
By default logfile name is "screenlog.0". You can set new logfile name with the "-Logfile" option.
screen -Logfile ...
-p
Preselect a window. This is useful when you want to reattach to a specific window or you want to send acommand via the "-X" option to a specific window. As with screen's select command, "-" selects the blankwindow. As a special case for reattach, "=" brings up the windowlist on the blank window, while a "+"will create a new window. The command will not be executed if the specified window could not be found.
screen -p ...
-r
resumes a detached screen session. No other options (except combinations with -d/-D) may be specified,though an optional prefix of [pid.]tty.host may be needed to distinguish between multiple detached screensessions. The second form is used to connect to another user's screen session which runs in multiusermode. This indicates that screen should look for sessions in another user's directory. This requiressetuid-root.
screen -r ...
-s
sets the default shell to the program specified, instead of the value in the environment variable $SHELL(or "/bin/sh" if not defined). This can also be defined through the "shell" .screenrc command. See alsothere.
screen -s ...
-S
When creating a new session, this option can be used to specify a meaningful name for the session. Thisname identifies the session for "screen -list" and "screen -r" actions. It substitutes the default[tty.host] suffix.
screen -S ...
-t
sets the title (a.k.a.) for the default shell or specified program. See also the "shelltitle" .screenrccommand.
screen -t ...
-T
Set the $TERM environment variable using the specified term as opposed to the default setting of screen.
screen -T ...
-v
Print version number.
screen -v ...
-wipe
does the same as "screen -ls", but removes destroyed sessions instead of marking them as `dead'. Anunreachable session is considered dead, when its name matches either the name of the local host, or theexplicitly given parameter, if any. See the -r flag for a description how to construct matches.
screen -wipe ...
-4
Resolve hostnames only to IPv4 addresses.
screen -4 ...
-6
DEFAULT KEY BINDINGSAs mentioned, each screen command consists of a "C-a" followed by one other character. For your convenience,all commands that are bound to lower-case letters are also bound to their control character counterparts (withthe exception of "C-a a"; see below), thus, "C-a c" as well as "C-a C-c" can be used to create a window. Seesection "CUSTOMIZATION" for a description of the command.The following table shows the default key bindings. The trailiing commas in boxes with multiple keystrokeentries are separators, not part of the bindings.┌─────────────────┬─────────────────┬───────────────────────────────┐│C-a ' │ (select) │ Prompt for a window name or ││ │ │ number to switch to. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a " │ (windowlist -b) │ Present a list of all windows ││ │ │ for selection. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a digit │ (select 0-9) │ Switch to window number 0 - 9 │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a - │ (select -) │ Switch to window number 0 - ││ │ │ 9, or to the blank window. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a tab │ (focus) │ Switch the input focus to the ││ │ │ next region. See also split, ││ │ │ remove, only. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a C-a │ (other) │ Toggle to the window dis‐ ││ │ │ played previously. Note that ││ │ │ this binding defaults to the ││ │ │ command character typed ││ │ │ twice, unless overridden. ││ │ │ For instance, if you use the ││ │ │ option "-e]x", this command ││ │ │ becomes "]]". │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a a │ (meta) │ Send the command character ││ │ │ (C-a) to window. See escape ││ │ │ command. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a A │ (title) │ Allow the user to enter a ││ │ │ name for the current window. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a b, │ (break) │ Send a break to window. ││C-a C-b │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a B │ (pow_break) │ Reopen the terminal line and ││ │ │ send a break. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a c, │ (screen) │ Create a new window with a ││C-a C-c │ │ shell and switch to that win‐ ││ │ │ dow. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a C │ (clear) │ Clear the screen. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a d, │ (detach) │ Detach screen from this ter‐ ││C-a C-d │ │ minal. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a D D │ (pow_detach) │ Detach and logout. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a f, │ (flow) │ Toggle flow on, off or auto. ││C-a C-f │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a F │ (fit) │ Resize the window to the cur‐ ││ │ │ rent region size. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a C-g │ (vbell) │ Toggles screen's visual bell ││ │ │ mode. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a h │ (hardcopy) │ Write a hardcopy of the cur‐ ││ │ │ rent window to the file ││ │ │ "hardcopy.n". │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a H │ (log) │ Begins/ends logging of the ││ │ │ current window to the file ││ │ │ "screenlog.n". │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a i, │ (info) │ Show info about this window. ││C-a C-i │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a k, │ (kill) │ Destroy current window. ││C-a C-k │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a l, │ (redisplay) │ Fully refresh current window. ││C-a C-l │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a L │ (login) │ Toggle this windows login ││ │ │ slot. Available only if ││ │ │ screen is configured to ││ │ │ update the utmp database. T{ ││ │ │ C-a m, ││ │ │ C-a C-m │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a M │ (monitor) │ Toggles monitoring of the ││ │ │ current window. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a space, │ (next) │ Switch to the next window. ││C-a n, │ │ ││C-a C-n │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a N │ (number) │ Show the number (and title) ││ │ │ of the current window. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a backspace, │ (prev) │ Switch to the previous window ││C-a C-h, │ │ (opposite of C-a n). ││C-a p, │ │ ││C-a C-p │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a q, │ (xon) │ Send a control-q to the cur‐ ││C-a C-q │ │ rent window. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a Q │ (only) │ Delete all regions but the ││ │ │ current one. See also split, ││ │ │ remove, focus. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a r, │ (wrap) │ Toggle the current window's ││C-a C-r │ │ line-wrap setting (turn the ││ │ │ current window's automatic ││ │ │ margins on and off). │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a s, │ (xoff) │ Send a control-s to the cur‐ ││C-a C-s; │ │ rent window. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a S │ (split) │ Split the current region hor‐ ││ │ │ izontally into two new ones. ││ │ │ See also only, remove, focus. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a t, │ (time) │ Show system information. ││C-a C-t │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a v │ (version) │ Display the version and com‐ ││ │ │ pilation date. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a C-v │ (digraph) │ Enter digraph. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a w, │ (windows) │ Show a list of window. ││C-a C-w │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a W │ (width) │ Toggle 80/132 columns. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a x or C-a C-x │ (lockscreen) │ Lock this terminal. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a X │ (remove) │ Kill the current region. See ││ │ │ also split, only, focus. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a z, │ (suspend) │ Suspend screen. Your system ││C-a C-z │ │ must support BSD-style job- ││ │ │ control. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a Z │ (reset) │ Reset the virtual terminal to ││ │ │ its "power-on" values. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a . │ (dumptermcap) │ Write out a ".termcap" file. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a ? │ (help) │ Show key bindings. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a \ │ (quit) │ Kill all windows and termi‐ ││ │ │ nate screen. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a : │ (colon) │ Enter command line mode. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a [, │ (copy) │ Enter copy/scrollback mode. ││C-a C-[, │ │ ││C-a esc │ │ │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a C-], │ (paste .) │ Write the contents of the ││C-a ] │ │ paste buffer to the stdin ││ │ │ queue of the current window. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a {, │ (history) │ Copy and paste a previous ││C-a } │ │ (command) line. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a > │ (writebuf) │ Write paste buffer to a file. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a < │ (readbuf) │ Reads the screen-exchange ││ │ │ file into the paste buffer. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a = │ (removebuf) │ Removes the file used by C-a ││ │ │ < and C-a >. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a , │ (license) │ Shows where screen comes ││ │ │ from, where it went to and ││ │ │ why you can use it. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a _ │ (silence) │ Start/stop monitoring the ││ │ │ current window for inactiv‐ ││ │ │ ity. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a | │ (split -v) │ Split the current region ver‐ ││ │ │ tically into two new ones. │├─────────────────┼─────────────────┼───────────────────────────────┤│C-a * │ (displays) │ Show a listing of all cur‐ ││ │ │ rently attached displays. │└─────────────────┴─────────────────┴───────────────────────────────┘CUSTOMIZATIONThe "socket directory" defaults either to $HOME/.screen or simply to /tmp/screens or preferably to /run/screenchosen at compile-time. If screen is installed setuid-root, then the administrator should compile screen withan adequate (not NFS mounted) socket directory. If screen is not running setuid-root, the user can specify anymode 700 directory in the environment variable $SCREENDIR.When screen is invoked, it executes initialization commands from the files "/etc/screenrc" and ".screenrc" inthe user's home directory. These are the "programmer's defaults" that can be overridden in the following ways:for the global screenrc file screen searches for the environment variable $SYSSCREENRC (this override featuremay be disabled at compile-time). The user specific screenrc file is searched in $SCREENRC, then$HOME/.screenrc. The command line option -c takes precedence over the above user screenrc files.Commands in these files are used to set options, bind functions to keys, and to automatically establish one ormore windows at the beginning of your screen session. Commands are listed one per line, with empty linesbeing ignored. A command's arguments are separated by tabs or spaces, and may be surrounded by single or dou‐ble quotes. A `#' turns the rest of the line into a comment, except in quotes. Unintelligible lines arewarned about and ignored. Commands may contain references to environment variables. The syntax is the shell-like "$VAR " or "${VAR}". Note that this causes incompatibility with previous screen versions, as now the'$'-character has to be protected with '\' if no variable substitution shall be performed. A string in single-quotes is also protected from variable substitution.Two configuration files are shipped as examples with your screen distribution: "etc/screenrc" and "etc/etc‐screenrc". They contain a number of useful examples for various commands.Customization can also be done 'on-line'. To enter the command mode type `C-a :'. Note that commands startingwith "def" change default values, while others change current settings.The following commands are available:acladd usernames [crypted-pw]addacl usernamesEnable users to fully access this screen session. Usernames can be one user or a comma separated list ofusers. This command enables to attach to the screen session and performs the equivalent of `aclchg usernames+rwx "#?"'. executed. To add a user with restricted access, use the `aclchg' command below. If an optionalsecond parameter is supplied, it should be a crypted password for the named user(s). `Addacl' is a synonym to`acladd'. Multi user mode only.aclchg usernames permbits listchacl usernames permbits listChange permissions for a comma separated list of users. Permission bits are represented as `r', `w' and `x'.Prefixing `+' grants the permission, `-' removes it. The third parameter is a comma separated list of commandsand/or windows (specified either by number or title). The special list `#' refers to all windows, `?' to allcommands. if usernames consists of a single `*', all known users are affected.A command can be executed when the user has the `x' bit for it. The user can type input to a window when hehas 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 window 2: `aclchg username -w+w 2'. To allow read-only accessto the session: `aclchg username -w "#"'. As soon as a user's name is known to screen he can attach to thesession and (per default) has full permissions for all command and windows. Execution permission for the aclcommands, `at' and others should also be removed or the user may be able to regain write permission. Rightsof the special username nobody cannot be changed (see the "su" command). `Chacl' is a synonym to `aclchg'.Multi user mode only.acldel usernameRemove a user from screen's access control list. If currently attached, all the user's displays are detachedfrom the session. He cannot attach again. Multi user mode only.aclgrp username [groupname]Creates groups of users that share common access rights. The name of the group is the username of the groupleader. Each member of the group inherits the permissions that are granted to the group leader. That means, ifa user fails an access check, another check is made for the group leader. A user is removed from all groupsthe special value "none" is used for groupname. If the second parameter is omitted all groups the user is inare listed.aclumask [[ users ] +bits | [ users ] -bits... ]umask [[ users ] +bits | [ users ] -bits... ]This specifies the access other users have to windows that will be created by the caller of the command.Users may be no, one or a comma separated list of known usernames. If no users are specified, a list of allcurrently known users is assumed. Bits is any combination of access control bits allowed defined with the"aclchg" command. The special username "?" predefines the access that not yet known users will be granted toany window initially. The special username "??" predefines the access that not yet known users are granted toany command. Rights of the special username nobody cannot be changed (see the "su" command). `Umask' is asynonym to `aclumask'.activity messageWhen any activity occurs in a background window that is being monitored, screen displays a notification in themessage line. The notification message can be re-defined by means of the "activity" command. Each occurrenceof `%' in message is replaced by the number of the window in which activity has occurred, and each occurrenceof `^G' is replaced by the definition for bell in your termcap (usually an audible bell). The default messageis'Activity in window %n'Note that monitoring is off for all windows by default, but can be altered by use of the "monitor" command (C-a M).allpartial on|offIf set to on, only the current cursor line is refreshed on window change. This affects all windows and isuseful for slow terminal lines. The previous setting of full/partial refresh for each window is restored with"allpartial off". This is a global flag that immediately takes effect on all windows overriding the "partial"settings. It does not change the default redraw behavior of newly created windows.altscreen on|offIf set to on, "alternate screen" support is enabled in virtual terminals, just like in xterm. Initial settingis `off'.at [identifier][#|*|%] command [args … ]Execute a command at other displays or windows as if it had been entered there. "At" changes the context (the`current window' or `current display' setting) of the command. If the first parameter describes a non-uniquecontext, the command will be executed multiple times. If the first parameter is of the form `identifier*' thenidentifier is matched against user names. The command is executed once for each display of the selecteduser(s). If the first parameter is of the form `identifier%' identifier is matched against displays. Displaysare named after the ttys they attach. The prefix `/dev/' or `/dev/tty' may be omitted from the identifier. Ifidentifier has a `#' or nothing appended it is matched against window numbers and titles. Omitting an identi‐fier in front of the `#', `*' or `%'-character selects all users, displays or windows because a prefix-matchis performed. Note that on the affected display(s) a short message will describe what happened. Permission ischecked for initiator of the "at" command, not for the owners of the affected display(s). Note that the '#'character works as a comment introducer when it is preceded by whitespace. This can be escaped by prefixing a'\'. Permission is checked for the initiator of the "at" command, not for the owners of the affected dis‐play(s).Caveat: When matching against windows, the command is executed at least once per window. Commands that changethe internal arrangement of windows (like "other") may be called again. In shared windows the command will berepeated for each attached display. Beware, when issuing toggle commands like "login"! Some commands (e.g."process") require that a display is associated with the target windows. These commands may not work cor‐rectly under "at" looping over windows.attrcolor attrib [attribute/color-modifier]This command can be used to highlight attributes by changing the color of the text. If the attribute attrib isin use, the specified attribute/color modifier is also applied. If no modifier is given, the current one isdeleted. See the "STRING ESCAPES" chapter for the syntax of the modifier. Screen understands two pseudo-attributes, "i" stands for high-intensity foreground color and "I" for high-intensity background color.Examples:attrcolor b "R"Change the color to bright red if bold text is to be printed.attrcolor u "-u b"Use blue text instead of underline.attrcolor b ".I"Use bright colors for bold text. Most terminal emulators do this already.attrcolor i "+b"Make bright colored text also bold.autodetach on|offSets whether screen will automatically detach upon hangup, which saves all your running programs until theyare resumed with a screen -r command. When turned off, a hangup signal will terminate screen and all the pro‐cesses it contains. Autodetach is on by default.autonuke on|offSets whether a clear screen sequence should nuke all the output that has not been written to the terminal. Seealso "obuflimit".backtick id lifespan autorefresh cmd args…backtick idProgram the backtick command with the numerical id id. The output of such a command is used for substitutionof the "%`" string escape. The specified lifespan is the number of seconds the output is considered valid.After this time, the command is run again if a corresponding string escape is encountered. The autorefreshparameter triggers an automatic refresh for caption and hardstatus strings after the specified number of sec‐onds. Only the last line of output is used for substitution.If both the lifespan and the autorefresh parameters are zero, the backtick program is expected to stay in thebackground and generate output once in a while. In this case, the command is executed right away and screenstores the last line of output. If a new line gets printed screen will automatically refresh the hardstatus orthe captions.The second form of the command deletes the backtick command with the numerical id id.bce [on|off]Change background-color-erase setting. If "bce" is set to on, all characters cleared by anerase/insert/scroll/clear operation will be displayed in the current background color. Otherwise the defaultbackground color is used.bell_msg [message]When a bell character is sent to a background window, screen displays a notification in the message line. Thenotification message can be re-defined by this command. Each occurrence of `%' in message is replaced by thenumber of the window to which a bell has been sent, and each occurrence of `^G' is replaced by the definitionfor bell in your termcap (usually an audible bell). The default message is'Bell in window %n'An empty message can be supplied to the "bell_msg" command to suppress output of a message line (bell_msg "").Without parameter, the current message is shown.bind [class] key [command [args]]Bind a command to a key. By default, most of the commands provided by screen are bound to one or more keys asindicated in the "DEFAULT KEY BINDINGS" section, e.g. the command to create a new window is bound to "C-c" and"c". The "bind" command can be used to redefine the key bindings and to define new bindings. The key argu‐ment is either a single character, a two-character sequence of the form "^x" (meaning "C-x"), a backslash fol‐lowed by an octal number (specifying the ASCII code of the character), or a backslash followed by a secondcharacter, such as "\^" or "\\". The argument can also be quoted, if you like. If no further argument isgiven, any previously established binding for this key is removed. The command argument can be any commandlisted in this section.If a command class is specified via the "-c" option, the key is bound for the specified class. Use the "com‐mand" command to activate a class. Command classes can be used to create multiple command keys or multi-char‐acter bindings.Some examples:bind ' ' windowsbind ^kbind kbind K killbind ^f screen telnet foobarbind \033 screen -ln -t root -h 1000 9 suwould bind the space key to the command that displays a list of windows (so that the command usually invokedby "C-a C-w" would also be available as "C-a space"). The next three lines remove the default kill bindingfrom "C-a C-k" and "C-a k". "C-a K" is then bound to the kill command. Then it binds "C-f" to the command"create a window with a TELNET connection to foobar", and bind "escape" to the command that creates an non-login window with a.k.a. "root" in slot #9, with a superuser shell and a scrollback buffer of 1000 lines.bind -c demo1 0 select 10bind -c demo1 1 select 11bind -c demo1 2 select 12bindkey "^B" command -c demo1makes "C-b 0" select window 10, "C-b 1" window 11, etc.bind -c demo2 0 select 10bind -c demo2 1 select 11bind -c demo2 2 select 12bind - command -c demo2makes "C-a - 0" select window 10, "C-a - 1" window 11, etc.bindkey [-d] [-m] [-a] [[-k|-t] string [cmd-args]]This command manages screen's input translation tables. Every entry in one of the tables tells screen how toreact if a certain sequence of characters is encountered. There are three tables: one that should containactions programmed by the user, one for the default actions used for terminal emulation and one for screen'scopy mode to do cursor movement. See section "INPUT TRANSLATION" for a list of default key bindings.If the -d option is given, bindkey modifies the default table, -m changes the copy mode table and with neitheroption the user table is selected. The argument string is the sequence of characters to which an action isbound. This can either be a fixed string or a termcap keyboard capability name (selectable with the -koption).Some keys on a VT100 terminal can send a different string if application mode is turned on (e.g the cursorkeys). Such keys have two entries in the translation table. You can select the application mode entry byspecifying the -a option.The -t option tells screen not to do inter-character timing. One cannot turn off the timing if a termcap capa‐bility is used.Cmd can be any of screen's commands with an arbitrary number of args. If cmd is omitted the key-binding isremoved from the table.Here are some examples of keyboard bindings:bindkey -dShow all of the default key bindings. The application mode entries are marked with [A].bindkey -k k1 select 1Make the "F1" key switch to window one.bindkey -t foo stuff barfooMake "foo" an abbreviation of the word "barfoo". Timeout is disabled so that users can type slowly.bindkey "\024" mapdefaultThis key-binding makes "^T" an escape character for key-bindings. If you did the above "stuff barfoo" binding,you can enter the word "foo" by typing "^Tfoo". If you want to insert a "^T" you have to press the key twice(i.e., escape the escape binding).bindkey -k F1 commandMake the F11 (not F1!) key an alternative screen escape (besides ^A).break[duration]Send a break signal for duration*0.25 seconds to this window. For non-Posix systems the time interval may berounded up to full seconds. Most useful if a character device is attached to the window rather than a shellprocess (See also chapter "WINDOW TYPES"). The maximum duration of a break signal is limited to 15 seconds.blankerActivate the screen blanker. First the screen is cleared. If no blanker program is defined, the cursor isturned off, otherwise, the program is started and it's output is written to the screen. The screen blanker iskilled with the first keypress, the read key is discarded.This command is normally used together with the "idle" command.blankerprg [program-args]Defines a blanker program. Disables the blanker program if an empty argument is given. Shows the currently setblanker program if no arguments are given.breaktype [tcsendbreak|TIOCSBRK|TCSBRK]Choose one of the available methods of generating a break signal for terminal devices. This command shouldaffect the current window only. But it still behaves identical to "defbreaktype". This will be changed in thefuture. Calling "breaktype" with no parameter displays the break method for the current window.bufferfile [exchange-file]Change the filename used for reading and writing with the paste buffer. If the optional argument to the"bufferfile" command is omitted, the default setting ("/tmp/screen-exchange") is reactivated. The followingexample will paste the system's password file into the screen window (using the paste buffer, where a copyremains):
screen -6 ...
-a
: bufferfile /etc/passwd
screen -a ...
-g
x or o exchanges the first mark and the current cursor position. You can use this to adjust an already placedmark.
screen -g ...
-’
‘r’ : read‘R’ : read only due to foreign wlock(2nd character)
screen -’ ...
-flow
+(+)flow flow control enabled. Agrees with automatic control.
screen -flow ...
-(+)flow
+(-)flow flow control enabled. Disagrees with automatic control.
screen -(+)flow ...
-(-)flow
The current line wrap setting (`+wrap' indicates enabled, `-wrap' not) is also shown. The flags `ins',`org', `app', `log', `mon' or `nored' are displayed when the window is in insert mode, origin mode,application-keypad mode, has output logging, activity monitoring or partial redraw enabled.The currently active character set (G0, G1, G2, or G3) and in square brackets the terminal charactersets that are currently designated as G0 through G3 is shown. If the window is in UTF-8 mode, thestring "UTF-8" is shown instead.Additional modes depending on the type of the window are displayed at the end of the status line (Seealso chapter "WINDOW TYPES").If the state machine of the terminal emulator is in a non-default state, the info line is started witha string identifying the current state.For system information use the "time" command.ins_reg [key]No longer exists, use "paste" instead.killKill current window.If there is an `exec' command running then it is killed. Otherwise the process (shell) running in thewindow receives a HANGUP condition, the window structure is removed and screen (your display) switchesto another window. When the last window is destroyed, screen exits. After a kill screen switches tothe previously displayed window.Note: Emacs users should keep this command in mind, when killing a line. It is recommended not to use"C-a" as the screen escape key or to rebind kill to "C-a K".lastmsgRedisplay the last contents of the message/status line. Useful if you're typing when a messageappears, because the message goes away when you press a key (unless your terminal has a hardware sta‐tus line). Refer to the commands "msgwait" and "msgminwait" for fine tuning.layout new [title]Create a new layout. The screen will change to one whole region and be switched to the blank window.From here, you build the regions and the windows they show as you desire. The new layout will be num‐bered with the smallest available integer, starting with zero. You can optionally give a title to yournew layout. Otherwise, it will have a default title of "layout". You can always change the title laterby using the command layout title.layout remove [n|title]Remove, or in other words, delete the specified layout. Either the number or the title can be speci‐fied. Without either specification, screen will remove the current layout.Removing a layout does not affect your set windows or regions.layout nextSwitch to the next layout availablelayout prevSwitch to the previous layout availablelayout select [n|title]Select the desired layout. Either the number or the title can be specified. Without either specifica‐tion, screen will prompt and ask which screen is desired. To see which layouts are available, use thelayout show command.layout showList on the message line the number(s) and title(s) of the available layout(s). The current layout isflagged.layout title [title]Change or display the title of the current layout. A string given will be used to name the layout.Without any options, the current title and number is displayed on the message line.layout number [n]Change or display the number of the current layout. An integer given will be used to number the layout.Without any options, the current number and title is displayed on the message line.layout attach [title|:last]Change or display which layout to reattach back to. The default is :last, which tells screen to reat‐tach back to the last used layout just before detachment. By supplying a title, You can instruct screento reattach to a particular layout regardless which one was used at the time of detachment. Without anyoptions, the layout to reattach to will be shown in the message line.layout save [n|title]Remember the current arrangement of regions. When used, screen will remember the arrangement of verti‐cally and horizontally split regions. This arrangement is restored when a screen session is reattachedor switched back from a different layout. If the session ends or the screen process dies, the layoutarrangements are lost. The layout dump command should help in this siutation. If a number or title issupplied, screen will remember the arrangement of that particular layout. Without any options, screenwill remember the current layout.Saving your regions can be done automatically by using the layout autosave command.layout autosave [on|off]Change or display the status of automatcally saving layouts. The default is on, meaning when screen isdetached or changed to a different layout, the arrangement of regions and windows will be remembered atthe time of change and restored upon return. If autosave is set to off, that arrangement will only berestored to either to the last manual save, using layout save, or to when the layout was first created,to a single region with a single window. Without either an on or off, the current status is displayedon the message line.layout dump [filename]Write to a file the order of splits made in the current layout. This is useful to recreate the order ofyour regions used in your current layout. Only the current layout is recorded. While the order of theregions are recorded, the sizes of those regions and which windows correspond to which regions are not.If no filename is specified, the default is layout-dump, saved in the directory that the screen processwas started in. If the file already exists, layout dump will append to that file. As an example:
screen -(-)flow ...
-
! invert the set in the current attributes= change the current attributes to the specified setThe attribute set can either be specified as a hexadecimal number or a combination of the following letters:d dimu underlineb boldr reverses standoutB blinkingColors are coded either as a hexadecimal number or two letters specifying the desired background and fore‐ground color (in that order). The following colors are known:k blackr redg greeny yellowb bluem magentac cyanw whited default color. leave color unchangedThe capitalized versions of the letter specify bright colors. You can also use the pseudo-color 'i' to setjust the brightness and leave the color unchanged.A one digit/letter color description is treated as foreground or background color dependent on the currentattributes: if reverse mode is set, the background color is changed instead of the foreground color. If youdon't like this, prefix the color with a ".". If you want the same behavior for two-letter color descriptions,also prefix them with a ".".As a special case, "%{-}" restores the attributes and colors that were set before the last change was made(i.e., pops one level of the color-change stack).Examples:"G" set color to bright green"+b r" use bold red"= yd" clear all attributes, write in default color on yellow background.
screen - ...
-Lw%{=
The available windows centered at the current window and truncated to the available width. The currentwindow is displayed white on blue. This can be used with "hardstatus alwayslastline".%?%F%{.R.}%?%3n %t%? [%h]%?The window number and title and the window's hardstatus, if one is set. Also use a red background ifthis is the active focus. Useful for "caption string".FLOW-CONTROLEach window has a flow-control setting that determines how screen deals with the XON and XOFF characters (andperhaps the interrupt character). When flow-control is turned off, screen ignores the XON and XOFF charac‐ters, which allows the user to send them to the current program by simply typing them (useful for the emacseditor, for instance). The trade-off is that it will take longer for output from a "normal" program to pausein response to an XOFF. With flow-control turned on, XON and XOFF characters are used to immediately pausethe output of the current window. You can still send these characters to the current program, but you mustuse the appropriate two-character screen commands (typically "C-a q" (xon) and "C-a s" (xoff)). The xon/xoffcommands are also useful for typing C-s and C-q past a terminal that intercepts these characters.Each window has an initial flow-control value set with either the -f option or the "defflow" .screenrc com‐mand. Per default the windows are set to automatic flow-switching. It can then be toggled between the threestates 'fixed on', 'fixed off' and 'automatic' interactively with the "flow" command bound to "C-a f".The automatic flow-switching mode deals with flow control using the TIOCPKT mode (like "rlogin" does). If thetty driver does not support TIOCPKT, screen tries to find out the right mode based on the current setting ofthe application keypad - when it is enabled, flow-control is turned off and visa versa. Of course, you canstill manipulate flow-control manually when needed.If you're running with flow-control enabled and find that pressing the interrupt key (usually C-c) does notinterrupt the display until another 6-8 lines have scrolled by, try running screen with the "interrupt" option(add the "interrupt" flag to the "flow" command in your .screenrc, or use the -i command-line option). Thiscauses the output that screen has accumulated from the interrupted program to be flushed. One disadvantage isthat the virtual terminal's memory contains the non-flushed version of the output, which in rare cases cancause minor inaccuracies in the output. For example, if you switch screens and return, or update the screenwith "C-a l" you would see the version of the output you would have gotten without "interrupt" being on.Also, you might need to turn off flow-control (or use auto-flow mode to turn it off automatically) when run‐ning a program that expects you to type the interrupt character as input, as it is possible to interrupt theoutput of the virtual terminal to your physical terminal when flow-control is enabled. If this happens, asimple refresh of the screen with "C-a l" will restore it. Give each mode a try, and use whichever mode youfind more comfortable.TITLES (naming windows)You can customize each window's name in the window display (viewed with the "windows" command (C-a w)) by set‐ting it with one of the title commands. Normally the name displayed is the actual command name of the programcreated in the window. However, it is sometimes useful to distinguish various programs of the same name or tochange the name on-the-fly to reflect the current state of the window.The default name for all shell windows can be set with the "shelltitle" command in the .screenrc file, whileall other windows are created with a "screen" command and thus can have their name set with the -t option.Interactively, there is the title-string escape-sequence (<esc>kname<esc>\) and the "title" command (C-a A).The former can be output from an application to control the window's name under software control, and the lat‐ter will prompt for a name when typed. You can also bind pre-defined names to keys with the "title" commandto set things quickly without prompting. Changing title bythis escape sequence can be controlled by defdynam‐ictitle and dynamictitle commands.Finally, screen has a shell-specific heuristic that is enabled by setting the window's name to "search|name"and arranging to have a null title escape-sequence output as a part of your prompt. The search portion speci‐fies an end-of-prompt search string, while the name portion specifies the default shell name for the window.If the name ends in a `:' screen will add what it believes to be the current command running in the window tothe end of the window's shell name (e.g. "name:cmd"). Otherwise the current command name supersedes the shellname while it is running.Here's how it works: you must modify your shell prompt to output a null title-escape-sequence (<esc>k<esc>\)as a part of your prompt. The last part of your prompt must be the same as the string you specified for thesearch portion of the title. Once this is set up, screen will use the title-escape-sequence to clear the pre‐vious command name and get ready for the next command. Then, when a newline is received from the shell, asearch is made for the end of the prompt. If found, it will grab the first word after the matched string anduse it as the command name. If the command name begins with either '!', '%', or '^' screen will use the firstword on the following line (if found) in preference to the just-found name. This helps csh users get bettercommand names when using job control or history recall commands.Here's some .screenrc examples:screen -t top 2 nice topAdding this line to your .screenrc would start a nice-d version of the "top" command in window 2 named "top"rather than "nice".shelltitle '> |csh'screen 1These commands would start a shell with the given shelltitle. The title specified is an auto-title that wouldexpect the prompt and the typed command to look something like the following:/usr/joe/src/dir> trn(it looks after the '> ' for the command name). The window status would show the name "trn" while the commandwas running, and revert to "csh" upon completion.bind R screen -t '% |root:' suHaving this command in your .screenrc would bind the key sequence "C-a R" to the "su" command and give it anauto-title name of "root:". For this auto-title to work, the screen could look something like this:% !ememacs file.cHere the user typed the csh history command "!em" which ran the previously entered "emacs" command. The win‐dow status would show "root:emacs" during the execution of the command, and revert to simply "root:" at itscompletion.bind o titlebind E title ""bind u title (unknown)The first binding doesn't have any arguments, so it would prompt you for a title. when you type "C-a o". Thesecond binding would clear an auto-title's current setting (C-a E). The third binding would set the currentwindow's title to "(unknown)" (C-a u).One thing to keep in mind when adding a null title-escape-sequence to your prompt is that some shells (likethe csh) count all the non-control characters as part of the prompt's length. If these invisible charactersaren't a multiple of 8 then backspacing over a tab will result in an incorrect display. One way to get aroundthis is to use a prompt like this:set prompt='^[[0000m^[k^[\% 'The escape-sequence "<esc>[0000m" not only normalizes the character attributes, but all the zeros round thelength of the invisible characters up to 8. Bash users will probably want to echo the escape sequence in thePROMPT_COMMAND:PROMPT_COMMAND='printf "\033k\033\134"'(I used "\134" to output a `\' because of a bug in bash v1.04).THE VIRTUAL TERMINALEach window in a screen session emulates a VT100 terminal, with some extra functions added. The VT100 emulatoris hard-coded, no other terminal types can be emulated.Usually screen tries to emulate as much of the VT100/ANSI standard as possible. But if your terminal lackscertain capabilities, the emulation may not be complete. In these cases screen has to tell the applicationsthat some of the features are missing. This is no problem on machines using termcap, because screen can usethe $TERMCAP variable to customize the standard screen termcap.But if you do a rlogin on another machine or your machine supports only terminfo this method fails. Because ofthis, screen offers a way to deal with these cases. Here is how it works:When screen tries to figure out a terminal name for itself, it first looks for an entry named "screen.<term>",where <term> is the contents of your $TERM variable. If no such entry exists, screen tries "screen" (or"screen-w" if the terminal is wide (132 cols or more)). If even this entry cannot be found, "vt100" is usedas a substitute.The idea is that if you have a terminal which doesn't support an important feature (e.g. delete char or clearto EOS) you can build a new termcap/terminfo entry for screen (named "screen.<dumbterm>") in which this capa‐bility has been disabled. If this entry is installed on your machines you are able to do a rlogin and stillkeep the correct termcap/terminfo entry. The terminal name is put in the $TERM variable of all new windows.Screen also sets the $TERMCAP variable reflecting the capabilities of the virtual terminal emulated. Noticethat, however, on machines using the terminfo database this variable has no effect. Furthermore, the variable$WINDOW is set to the window number of each window.The actual set of capabilities supported by the virtual terminal depends on the capabilities supported by thephysical terminal. If, for instance, the physical terminal does not support underscore mode, screen does notput the `us' and `ue' capabilities into the window's $TERMCAP variable, accordingly. However, a minimum num‐ber of capabilities must be supported by a terminal in order to run screen; namely scrolling, clear screen,and direct cursor addressing (in addition, screen does not run on hardcopy terminals or on terminals thatover-strike).Also, you can customize the $TERMCAP value used by screen by using the "termcap" .screenrc command, or bydefining the variable $SCREENCAP prior to startup. When the is latter defined, its value will be copied ver‐batim into each window's $TERMCAP variable. This can either be the full terminal definition, or a filenamewhere the terminal "screen" (and/or "screen-w") is defined.Note that screen honors the "terminfo" .screenrc command if the system uses the terminfo database rather thantermcap.When the boolean `G0' capability is present in the termcap entry for the terminal on which screen has beencalled, the terminal emulation of screen supports multiple character sets. This allows an application to makeuse of, for instance, the VT100 graphics character set or national character sets. The following controlfunctions from ISO 2022 are supported: lock shift G0 (SI), lock shift G1 (SO), lock shift G2, lock shift G3,single shift G2, and single shift G3. When a virtual terminal is created or reset, the ASCII character set isdesignated as G0 through G3. When the `G0' capability is present, screen evaluates the capabilities `S0',`E0', and `C0' if present. `S0' is the sequence the terminal uses to enable and start the graphics characterset rather than SI. `E0' is the corresponding replacement for SO. `C0' gives a character by character trans‐lation string that is used during semi-graphics mode. This string is built like the `acsc' terminfo capabil‐ity.When the `po' and `pf' capabilities are present in the terminal's termcap entry, applications running in ascreen window can send output to the printer port of the terminal. This allows a user to have an applicationin one window sending output to a printer connected to the terminal, while all other windows are still active(the printer port is enabled and disabled again for each chunk of output). As a side-effect, programs runningin different windows can send output to the printer simultaneously. Data sent to the printer is not displayedin the window. The info command displays a line starting `PRIN' while the printer is active.Screen maintains a hardstatus line for every window. If a window gets selected, the display's hardstatus willbe updated to match the window's hardstatus line. If the display has no hardstatus the line will be displayedas a standard screen message. The hardstatus line can be changed with the ANSI Application Program Command(APC): "ESC_<string>ESC\". As a convenience for xterm users the sequence "ESC]0..2;<string>^G" is alsoaccepted.Some capabilities are only put into the $TERMCAP variable of the virtual terminal if they can be efficientlyimplemented by the physical terminal. For instance, `dl' (delete line) is only put into the $TERMCAP variableif the terminal supports either delete line itself or scrolling regions. Note that this may provoke confusion,when the session is reattached on a different terminal, as the value of $TERMCAP cannot be modified by parentprocesses.The "alternate screen" capability is not enabled by default. Set the altscreen .screenrc command to enableit.The following is a list of control sequences recognized by screen. "(V)" and "(A)" indicate VT100-specificand ANSI- or ISO-specific functions, respectively.ESC E Next LineESC D IndexESC M Reverse IndexESC H Horizontal Tab SetESC Z Send VT100 Identification StringESC 7 (V) Save Cursor and AttributesESC 8 (V) Restore Cursor and AttributesESC [s (A) Save Cursor and AttributesESC [u (A) Restore Cursor and AttributesESC c Reset to Initial StateESC g Visual BellESC Pn p Cursor Visibility (97801)Pn = 6 InvisiblePn = 7 VisibleESC = (V) Application Keypad ModeESC > (V) Numeric Keypad ModeESC # 8 (V) Fill Screen with E'sESC \ (A) String TerminatorESC ^ (A) Privacy Message String (Message Line)ESC ! Global Message String (Message Line)ESC k A.k.a. Definition StringESC P (A) Device Control String. Outputs a string directly to the host terminal withoutinterpretation.ESC _ (A) Application Program Command (Hardstatus)ESC ] 0 ; string ^G (A) Operating System Command (Hardstatus, xterm title hack)ESC ] 83 ; cmd ^G (A) Execute screen command. This only works if multi-user support is compiled intoscreen. The pseudo-user ":window:" is used to check the access control list. Use"addacl :window: -rwx #?" to create a user with no rights and allow only the neededcommands.Control-N (A) Lock Shift G1 (SO)Control-O (A) Lock Shift G0 (SI)ESC n (A) Lock Shift G2ESC o (A) Lock Shift G3ESC N (A) Single Shift G2ESC O (A) Single Shift G3ESC ( Pcs (A) Designate character set as G0ESC ) Pcs (A) Designate character set as G1ESC * Pcs (A) Designate character set as G2ESC + Pcs (A) Designate character set as G3ESC [ Pn ; Pn H Direct Cursor AddressingESC [ Pn ; Pn f same as aboveESC [ Pn J Erase in DisplayPn = None or 0 From Cursor to End of ScreenPn = 1 From Beginning of Screen to CursorPn = 2 Entire ScreenESC [ Pn K Erase in LinePn = None or 0 From Cursor to End of LinePn = 1 From Beginning of Line to CursorPn = 2 Entire LineESC [ Pn X Erase characterESC [ Pn A Cursor UpESC [ Pn B Cursor DownESC [ Pn C Cursor RightESC [ Pn D Cursor LeftESC [ Pn E Cursor next lineESC [ Pn F Cursor previous lineESC [ Pn G Cursor horizontal positionESC [ Pn ` same as aboveESC [ Pn d Cursor vertical positionESC [ Ps ;…; Ps m Select Graphic RenditionPs = None or 0 Default RenditionPs = 1 BoldPs = 2 (A) FaintPs = 3 (A) Standout Mode (ANSI: Italicized)Ps = 4 UnderlinedPs = 5 BlinkingPs = 7 Negative ImagePs = 22 (A) Normal IntensityPs = 23 (A) Standout Mode off (ANSI: Italicized off)Ps = 24 (A) Not UnderlinedPs = 25 (A) Not BlinkingPs = 27 (A) Positive ImagePs = 30 (A) Foreground BlackPs = 31 (A) Foreground RedPs = 32 (A) Foreground GreenPs = 33 (A) Foreground YellowPs = 34 (A) Foreground BluePs = 35 (A) Foreground MagentaPs = 36 (A) Foreground CyanPs = 37 (A) Foreground WhitePs = 39 (A) Foreground DefaultPs = 40 (A) Background BlackPs = … …Ps = 49 (A) Background DefaultESC [ Pn g Tab ClearPn = None or 0 Clear Tab at Current PositionPn = 3 Clear All TabsESC [ Pn ; Pn r (V) Set Scrolling RegionESC [ Pn I (A) Horizontal TabESC [ Pn Z (A) Backward TabESC [ Pn L (A) Insert LineESC [ Pn M (A) Delete LineESC [ Pn @ (A) Insert CharacterESC [ Pn P (A) Delete CharacterESC [ Pn S Scroll Scrolling Region UpESC [ Pn T Scroll Scrolling Region DownESC [ Pn ^ same as aboveESC [ Ps ;…; Ps h Set ModeESC [ Ps ;…; Ps l Reset ModePs = 4 (A) Insert ModePs = 20 (A) Automatic Linefeed ModePs = 34 Normal Cursor VisibilityPs = ?1 (V) Application Cursor KeysPs = ?3 (V) Change Terminal Width to 132 columnsPs = ?5 (V) Reverse VideoPs = ?6 (V) Origin ModePs = ?7 (V) Wrap ModePs = ?9 X10 mouse trackingPs = ?25 (V) Visible CursorPs = ?47 Alternate Screen (old xterm code)Ps = ?1000 (V) VT200 mouse trackingPs = ?1047 Alternate Screen (new xterm code)Ps = ?1049 Alternate Screen (new xterm code)ESC [ 5 i (A) Start relay to printer (ANSI Media Copy)ESC [ 4 i (A) Stop relay to printer (ANSI Media Copy)ESC [ 8 ; Ph ; Pw t Resize the window to `Ph' lines and `Pw' columns (SunView special)ESC [ c Send VT100 Identification StringESC [ x Send Terminal Parameter ReportESC [ > c Send VT220 Secondary Device Attributes StringESC [ 6 n Send Cursor Position ReportINPUT TRANSLATIONIn order to do a full VT100 emulation screen has to detect that a sequence of characters in the input streamwas generated by a keypress on the user's keyboard and insert the VT100 style escape sequence. Screen has avery flexible way of doing this by making it possible to map arbitrary commands on arbitrary sequences ofcharacters. For standard VT100 emulation the command will always insert a string in the input buffer of thewindow (see also command stuff in the command table). Because the sequences generated by a keypress canchange after a reattach from a different terminal type, it is possible to bind commands to the termcap name ofthe keys. Screen will insert the correct binding after each reattach. See the bindkey command for furtherdetails on the syntax and examples.Here is the table of the default key bindings. The fourth is what command is executed if the keyboard isswitched into application mode.┌────────────────┬──────────────┬──────────┬──────────┐│Key name │ Termcap name │ Command │ App mode │├────────────────┼──────────────┼──────────┼──────────┤│Cursor up │ ku │ \033[A │ \033OA │├────────────────┼──────────────┼──────────┼──────────┤│Cursor down │ kd │ \033[B │ \033OB │├────────────────┼──────────────┼──────────┼──────────┤│Cursor right │ kr │ \033[C │ \033OC │├────────────────┼──────────────┼──────────┼──────────┤│Cursor left │ kl │ \033[D │ \033OD │├────────────────┼──────────────┼──────────┼──────────┤│Function key 0 │ k0 │ \033[10~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 1 │ k1 │ \033OP │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 2 │ k2 │ \033OQ │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 3 │ k3 │ \033OR │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 4 │ k4 │ \033OS │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 5 │ k5 │ \033[15~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 6 │ k6 │ \033[17~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 7 │ k7 │ \033[18~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 8 │ k8 │ \033[19~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 9 │ k9 │ \033[20~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 10 │ k; │ \033[21~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 11 │ F1 │ \033[23~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Function key 12 │ F2 │ \033[24~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Home │ kh │ \033[1~ │ │├────────────────┼──────────────┼──────────┼──────────┤│End │ kH │ \033[4~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Insert │ kI │ \033[2~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Delete │ kD │ \033[3~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Page up │ kP │ \033[5~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Page down │ kN │ \033[6~ │ │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 0 │ f0 │ 0 │ \033Op │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 1 │ f1 │ 1 │ \033Oq │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 2 │ f2 │ 2 │ \033Or │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 3 │ f3 │ 3 │ \033Os │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 4 │ f4 │ 4 │ \033Ot │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 5 │ f5 │ 5 │ \033Ou │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 6 │ f6 │ 6 │ \033Ov │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 7 │ f7 │ 7 │ \033Ow │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 8 │ f8 │ 8 │ \033Ox │├────────────────┼──────────────┼──────────┼──────────┤│Keypad 9 │ f9 │ 9 │ \033Oy │├────────────────┼──────────────┼──────────┼──────────┤│Keypad + │ f+ │ + │ \033Ok │├────────────────┼──────────────┼──────────┼──────────┤│Keypad - │ f- │ - │ \033Om │├────────────────┼──────────────┼──────────┼──────────┤│Keypad * │ f* │ * │ \033Oj │├────────────────┼──────────────┼──────────┼──────────┤│Keypad / │ f/ │ / │ \033Oo │├────────────────┼──────────────┼──────────┼──────────┤│Keypad = │ fq ├──────────┤ \033OX │├────────────────┼──────────────┼──────────┼──────────┤│Keypad . │ f. │ . │ \033On │├────────────────┼──────────────┼──────────┼──────────┤│Keypad , │ f, │ , │ \033Ol │├────────────────┼──────────────┼──────────┼──────────┤│Keypad enter │ fe │ \015 │ \033OM │└────────────────┴──────────────┴──────────┴──────────┘SPECIAL TERMINAL CAPABILITIESThe following table describes all terminal capabilities that are recognized by screen and are not in the term‐cap(5) manual. You can place these capabilities in your termcap entries (in `/etc/termcap') or use them withthe commands `termcap', `terminfo' and `termcapinfo' in your screenrc files. It is often not possible to placethese capabilities in the terminfo database.LP (bool) Terminal has VT100 style margins (`magic margins'). Note that this capability is obsolete becausescreen uses the standard 'xn' instead.Z0 (str) Change width to 132 columns.Z1 (str) Change width to 80 columns.WS (str) Resize display. This capability has the desired width and height as arguments. SunView(tm) exam‐ple: '\E[8;%d;%dt'.NF (bool) Terminal doesn't need flow control. Send ^S and ^Q direct to the application. Same as 'flow off'.The opposite of this capability is 'nx'.G0 (bool) Terminal can deal with ISO 2022 font selection sequences.S0 (str) Switch charset 'G0' to the specified charset. Default is '\E(%.'.E0 (str) Switch charset 'G0' back to standard charset. Default is '\E(B'.C0 (str) Use the string as a conversion table for font '0'. See the 'ac' capability for more details.CS (str) Switch cursor-keys to application mode.CE (str) Switch cursor-keys back to normal mode.AN (bool) Turn on autonuke. See the 'autonuke' command for more details.OL (num) Set the output buffer limit. See the 'obuflimit' command for more details.KJ (str) Set the encoding of the terminal. See the 'encoding' command for valid encodings.AF (str) Change character foreground color in an ANSI conform way. This capability will almost always beset to '\E[3%dm' ('\E[3%p1%dm' on terminfo machines).AB (str) Same as 'AF', but change background color.AX (bool) Does understand ANSI set default fg/bg color (\E[39m / \E[49m).XC (str) Describe a translation of characters to strings depending on the current font. More details fol‐low in the next section.XT (bool) Terminal understands special xterm sequences (OSC, mouse tracking).C8 (bool) Terminal needs bold to display high-intensity colors (e.g. Eterm).TF (bool) Add missing capabilities to the termcap/info entry. (Set by default).CHARACTER TRANSLATIONScreen has a powerful mechanism to translate characters to arbitrary strings depending on the current font andterminal type. Use this feature if you want to work with a common standard character set (say ISO8851-latin1)even on terminals that scatter the more unusual characters over several national language font pages.Syntax:XC=<charset-mapping>{,,<charset-mapping>}<charset-mapping> := <designator><template>{,<mapping>}<mapping> := <char-to-be-mapped><template-arg>The things in braces may be repeated any number of times.A <charset-mapping> tells screen how to map characters in font <designator> ('B': Ascii, 'A': UK, 'K': German,etc.) to strings. Every <mapping> describes to what string a single character will be translated. A templatemechanism is used, as most of the time the codes have a lot in common (for example strings to switch to andfrom another charset). Each occurrence of '%' in <template> gets substituted with the <template-arg> specifiedtogether with the character. If your strings are not similar at all, then use '%' as a template and place thefull string in <template-arg>. A quoting mechanism was added to make it possible to use a real '%'. The '\'character quotes the special characters '\', '%', and ','.Here is an example:termcap hp700 'XC=B\E(K%\E(B,\304[,\326\\\\,\334]'This tells screen how to translate ISOlatin1 (charset 'B') upper case umlaut characters on a hp700 terminalthat has a German charset. '\304' gets translated to '\E(K[\E(B' and so on. Note that this line gets parsed*three* times before the internal lookup table is built, therefore a lot of quoting is needed to create a sin‐gle '\'.Another extension was added to allow more emulation: If a mapping translates the unquoted '%' char, it will besent to the terminal whenever screen switches to the corresponding <designator>. In this special case the tem‐plate is assumed to be just '%' because the charset switch sequence and the character mappings normallyhaven't much in common.This example shows one use of the extension:termcap xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334'Here, a part of the German ('K') charset is emulated on an xterm. If screen has to change to the 'K' charset,'\E(B' will be sent to the terminal, i.e. the ASCII charset is used instead. The template is just '%', so themapping is straightforward: '[' to '\304', '\' to '\326', and ']' to '\334'.ENVIRONMENTCOLUMNS Number of columns on the terminal (overrides termcap entry).HOME Directory in which to look for .screenrc.LINES Number of lines on the terminal (overrides termcap entry).LOCKPRG Screen lock program.NETHACKOPTIONS Turns on nethack option.PATH Used for locating programs to run.SCREENCAP For customizing a terminal's TERMCAP value.SCREENDIR Alternate socket directory.SCREENRC Alternate user screenrc file.SHELL Default shell program for opening windows (default "/bin/sh"). See also "shell" .screenrc com‐mand.STY Alternate socket name.SYSSCREENRC Alternate system screenrc file.TERM Terminal name.TERMCAP Terminal description.WINDOW Window number of a window (at creation time).FILES…/screen-4.?.??/etc/screenrc…/screen-4.?.??/etc/etcscreenrc Examples in the screen distribution package for private and global initial‐ization files.$SYSSCREENRC/etc/screenrc screen initialization commands$SCREENRC$HOME/.screenrc Read in after /etc/screenrc$SCREENDIR/S-<login>/run/screen/S-<login> Socket directories (default)/usr/tmp/screens/S-<login> Alternate socket directories.<socket directory>/.termcap Written by the "termcap" output function/usr/tmp/screens/screen-exchange or/tmp/screen-exchange screen `interprocess communication buffer'hardcopy.[0-9] Screen images created by the hardcopy functionscreenlog.[0-9] Output log files created by the log function/usr/lib/terminfo/?/* or/etc/termcap Terminal capability databases/run/utmp Login records$LOCKPRG Program that locks a terminal.
screen -Lw%{= ...