1 \input texinfo @c -*-texinfo-*-
4 @setfilename screen.info
5 @settitle Screen User's Manual
6 @dircategory General Commands
13 * Screen: (screen). Full-screen window manager.
16 @c For examples, use a literal escape in info.
25 This file documents the @code{Screen} virtual terminal manager.
27 Copyright (c) 1993-2003 Free Software Foundation, Inc.
29 Permission is granted to make and distribute verbatim copies of
30 this manual provided the copyright notice and this permission notice
31 are preserved on all copies.
34 Permission is granted to process this file through TeX and print the
35 results, provided the printed document carries copying permission
36 notice identical to this one except for the removal of this paragraph
37 (this paragraph not being relevant to the printed manual).
40 Permission is granted to copy and distribute modified versions of this
41 manual under the conditions for verbatim copying, provided that the entire
42 resulting derived work is distributed under the terms of a permission
43 notice identical to this one.
45 Permission is granted to copy and distribute translations of this manual
46 into another language, under the above conditions for modified versions,
47 except that this permission notice may be stated in a translation approved
53 @subtitle The virtual terminal manager
54 @subtitle for Version @value{version}
58 @vskip 0pt plus 1filll
59 Copyright @copyright{} 1993-2003 Free Software Foundation, Inc.
61 Permission is granted to make and distribute verbatim copies of
62 this manual provided the copyright notice and this permission notice
63 are preserved on all copies.
65 Permission is granted to copy and distribute modified versions of this
66 manual under the conditions for verbatim copying, provided that the entire
67 resulting derived work is distributed under the terms of a permission
68 notice identical to this one.
70 Permission is granted to copy and distribute translations of this manual
71 into another language, under the above conditions for modified versions,
72 except that this permission notice may be stated in a translation approved
76 @node Top, Overview, (dir), (dir)
80 This file documents the @code{Screen} virtual terminal manager, version
85 * Overview:: Preliminary information.
86 * Getting Started:: An introduction to @code{screen}.
87 * Invoking Screen:: Command line options for @code{screen}.
88 * Customization:: The @file{.screenrc} file.
89 * Commands:: List all of the commands.
90 * New Window:: Running a program in a new window.
91 * Selecting:: Selecting a window to display.
92 * Session Management:: Suspend/detach, grant access, connect sessions.
93 * Regions:: Split-screen commands.
94 * Window Settings:: Titles, logging, etc.
95 * Virtual Terminal:: Controlling the @code{screen} VT100 emulation.
96 * Copy and Paste:: Exchanging text between windows and sessions.
97 * Subprocess Execution:: I/O filtering with @code{exec}.
98 * Key Binding:: Binding commands to keys.
99 * Flow Control:: Trap or pass flow control characters.
100 * Termcap:: Tweaking your terminal's termcap entry.
101 * Message Line:: The @code{screen} message line.
102 * Logging:: Keeping a record of your session.
103 * Startup:: Functions only useful at @code{screen} startup.
104 * Miscellaneous:: Various other commands.
105 * String Escapes:: Inserting current information into strings
106 * Environment:: Environment variables used by @code{screen}.
107 * Files:: Files used by @code{screen}.
108 * Credits:: Who's who of @code{screen}.
109 * Bugs:: What to do if you find a bug.
110 * Installation:: Getting @code{screen} running on your system.
111 * Concept Index:: Index of concepts.
112 * Command Index:: Index of all @code{screen} commands.
113 * Keystroke Index:: Index of default key bindings.
116 @node Overview, Getting Started, Top, Top
120 Screen is a full-screen window manager that multiplexes a physical
121 terminal between several processes, typically interactive shells. Each
122 virtual terminal provides the functions of the DEC VT100 terminal and,
123 in addition, several control functions from the ISO 6429 (ECMA 48, ANSI X3.64)
124 and ISO 2022 standards (e.g. insert/delete line and support for multiple
125 character sets). There is a scrollback history buffer for each virtual
126 terminal and a copy-and-paste mechanism that allows the user to move
127 text regions between windows.
129 When @code{screen} is called, it creates a single window with a shell in
130 it (or the specified command) and then gets out of your way so that you
131 can use the program as you normally would. Then, at any time, you can
132 create new (full-screen) windows with other programs in them (including
133 more shells), kill the current window, view a list of the active
134 windows, turn output logging on and off, copy text between windows, view
135 the scrollback history, switch between windows, etc. All windows run
136 their programs completely independent of each other. Programs continue
137 to run when their window is currently not visible and even when the
138 whole screen session is detached from the user's terminal.
140 When a program terminates, @code{screen} (per default) kills the window
141 that contained it. If this window was in the foreground, the display
142 switches to the previously displayed window; if none are left,
145 Everything you type is sent to the program running in the current
146 window. The only exception to this is the one keystroke that is used to
147 initiate a command to the window manager. By default, each command
148 begins with a control-a (abbreviated @kbd{C-a} from now on), and is
149 followed by one other keystroke. The command character (@pxref{Command
150 Character}) and all the key bindings (@pxref{Key Binding}) can be fully
151 customized to be anything you like, though they are always two
152 characters in length.
154 @code{Screen} does not understand the prefix @kbd{C-} to mean control.
155 Please use the caret notation (@kbd{^A} instead of @kbd{C-a}) as arguments
156 to e.g. the @code{escape} command or the @code{-e} option. @code{Screen}
157 will also print out control characters in caret notation.
159 The standard way to create a new window is to type @kbd{C-a c}. This
160 creates a new window running a shell and switches to that window
161 immediately, regardless of the state of the process running in the
162 current window. Similarly, you can create a new window with a custom
163 command in it by first binding the command to a keystroke (in your
164 @file{.screenrc} file or at the @kbd{C-a :} command line) and then using it
165 just like the @kbd{C-a c} command. In addition, new windows can be created by
166 running a command like:
173 from a shell prompt within a previously created window. This will not
174 run another copy of @code{screen}, but will instead supply the command
175 name and its arguments to the window manager (specified in the $STY environment
176 variable) who will use it to create the new window. The above example would
177 start the @code{emacs} editor (editing @file{prog.c}) and switch to its window.
178 - Note that you cannot transport environment variables from
179 the invoking shell to the application (emacs in this case), because it is
180 forked from the parent screen process, not from the invoking shell.
182 If @file{/etc/utmp} is writable by @code{screen}, an appropriate record
183 will be written to this file for each window, and removed when the
184 window is closed. This is useful for working with @code{talk},
185 @code{script}, @code{shutdown}, @code{rsend}, @code{sccs} and other
186 similar programs that use the utmp file to determine who you are. As
187 long as @code{screen} is active on your terminal, the terminal's own
188 record is removed from the utmp file. @xref{Login}.
190 @node Getting Started, Invoking Screen, Overview, Top
191 @chapter Getting Started
194 Before you begin to use @code{screen} you'll need to make sure you have
195 correctly selected your terminal type, just as you would for any other
196 termcap/terminfo program. (You can do this by using @code{tset},
197 @code{qterm}, or just @code{set term=mytermtype}, for example.)
199 If you're impatient and want to get started without doing a lot more
200 reading, you should remember this one command: @kbd{C-a ?} (@pxref{Key
201 Binding}). Typing these two characters will display a list of the
202 available @code{screen} commands and their bindings. Each keystroke is
203 discussed in the section on keystrokes (@pxref{Default Key Bindings}).
204 Another section (@pxref{Customization}) deals with the contents of your
207 If your terminal is a ``true'' auto-margin terminal (it doesn't allow
208 the last position on the screen to be updated without scrolling the
209 screen) consider using a version of your terminal's termcap that has
210 automatic margins turned @emph{off}. This will ensure an accurate
211 and optimal update of the screen in all circumstances. Most terminals
212 nowadays have ``magic'' margins (automatic margins plus usable last
213 column). This is the VT100 style type and perfectly suited for
215 If all you've got is a ``true'' auto-margin terminal @code{screen}
216 will be content to use it, but updating a character put into the last
217 position on the screen may not be possible until the screen scrolls or
218 the character is moved into a safe position in some other way. This
219 delay can be shortened by using a terminal with insert-character
222 @xref{Special Capabilities}, for more information about telling
223 @code{screen} what kind of terminal you have.
225 @node Invoking Screen, Customization, Getting Started, Top
226 @chapter Invoking @code{Screen}
229 @cindex command line options
231 Screen has the following command-line options:
235 Include @emph{all} capabilities (with some minor exceptions) in each
236 window's termcap, even if @code{screen} must redraw parts of the display
237 in order to implement a function.
240 Adapt the sizes of all windows to the size of the display. By default,
241 @code{screen} may try to restore its old window sizes when attaching to
242 resizable terminals (those with @samp{WS} in their descriptions, e.g.
243 @code{suncmd} or some varieties of @code{xterm}).
246 Use @var{file} as the user's configuration file instead of the default
247 of @file{$HOME/.screenrc}.
249 @item -d [@var{pid.sessionname}]
250 @itemx -D [@var{pid.sessionname}]
251 Do not start @code{screen}, but instead detach a @code{screen} session
252 running elsewhere (@pxref{Detach}). @samp{-d} has the same effect as
253 typing @kbd{C-a d} from the controlling terminal for the session.
254 @samp{-D} is the equivalent to the power detach key. If no session can
255 be detached, this option is ignored. In combination with the
256 @code{-r}/@code{-R} option more powerful effects can be achieved:
260 Reattach a session and if necessary detach it first.
262 Reattach a session and if necessary detach or even create it first.
264 Reattach a session and if necessary detach or create it.
265 Use the first session if more than one session is available.
267 Reattach a session. If necessary detach and logout remotely first.
269 Attach here and now. In detail this means: If a session is running,
270 then reattach. If necessary detach and logout remotely first. If it
271 was not running create it and notify the user.
272 This is the author's favorite.
274 Attach here and now. Whatever that means, just do it.
277 @emph{Note}: It is a good idea to check the status of your sessions
278 with @code{screen -list} before using this option.
281 Set the command character to @var{x}, and the character generating a
282 literal command character (when typed after the command character) to
283 @var{y}. The defaults are @kbd{C-a} and @kbd{a}, which can be specified
284 as @samp{-e^Aa}. When creating a @code{screen} session, this option
285 sets the default command character. In a multiuser session all users
286 added will start off with this command character. But when attaching
287 to an already running session, this option only changes the command
288 character of the attaching user.
289 This option is equivalent to the commands @code{defescape} or
290 @code{escape} respectively. (@pxref{Command Character}).
295 Set flow-control to on, off, or automatic switching mode, respectively.
296 This option is equivalent to the @code{defflow} command (@pxref{Flow
300 Set the history scrollback buffer to be @var{num} lines high.
301 Equivalent to the @code{defscrollback} command (@pxref{Copy}).
304 Cause the interrupt key (usually @kbd{C-c}) to interrupt the display
305 immediately when flow control is on. This option is equivalent to the
306 @code{interrupt} argument to the @code{defflow} command (@pxref{Flow
307 Control}). Its use is discouraged.
311 Turn login mode on or off (for @file{/etc/utmp} updating). This option
312 is equivalent to the @code{deflogin} command (@pxref{Login}).
314 @item -ls [@var{match}]
315 @itemx -list [@var{match}]
316 Do not start @code{screen}, but instead print a list of session
317 identification strings (usually of the form @var{pid.tty.host};
318 @pxref{Session Name}). Sessions marked @samp{detached} can be resumed
319 with @code{screen -r}. Those marked @samp{attached} are running and
320 have a controlling terminal. If the session runs in multiuser mode,
321 it is marked @samp{multi}. Sessions marked as @samp{unreachable} either
322 live on a different host or are dead.
323 An unreachable session is considered dead, when its name matches either the
324 name of the local host, or the specified parameter, if any.
325 See the @code{-r} flag for a description how to construct matches.
326 Sessions marked as @samp{dead} should be thoroughly checked and removed.
327 Ask your system administrator if you are not sure.
328 Remove sessions with the @samp{-wipe} option.
331 Tell @code{screen} to turn on automatic output logging for the
335 Tell @code{screen} to ignore the @code{$STY} environment variable. When
336 this option is used, a new session will always be created, regardless of
337 whether @code{screen} is being called from within another @code{screen}
338 session or not. This flag has a special meaning in connection
339 with the @samp{-d} option:
342 Start @code{screen} in @emph{detached} mode. This creates a new
343 session but doesn't attach to it. This is useful for system startup
346 This also starts @code{screen} in @emph{detached} mode, but doesn't fork
347 a new process. The command exits if the session terminates.
351 Select a more optimal output mode for your terminal rather than true VT100
352 emulation (only affects auto-margin terminals without @samp{LP}). This
353 can also be set in your @file{.screenrc} by specifying @samp{OP} in the
354 @code{termcap} command.
356 @item -p @var{name_or_number}|-|=|+
357 Preselect a window. This is useful when you want to reattach to a
358 specific window or you want to send a command via the @samp{-X}
359 option to a specific window. As with screen's select command, @samp{-}
360 selects the blank window. As a special case for reattach, @samp{=}
361 brings up the windowlist on the blank window, while a @samp{+} will
365 Suppress printing of error messages. In combination with @samp{-ls} the exit
366 value is set as follows: 9 indicates a directory without sessions. 10
367 indicates a directory with running but not attachable sessions. 11 (or more)
368 indicates 1 (or more) usable sessions.
369 In combination with @samp{-r} the exit value is as follows: 10 indicates that
370 there is no session to resume. 12 (or more) indicates that there are 2 (or
371 more) sessions to resume and you should specify which one to choose.
372 In all other cases @samp{-q} has no effect.
374 @item -r [@var{pid.sessionname}]
375 @itemx -r @var{sessionowner}/[@var{pid.sessionname}]
376 Resume a detached @code{screen} session. No other options (except
377 combinations with @samp{-d} or @samp{-D}) may be specified, though
379 (@pxref{Session Name}) may be needed to distinguish between multiple
380 detached @code{screen} sessions.
381 The second form is used to connect to another user's screen session which
382 runs in multiuser mode. This indicates that screen should look for
383 sessions in another user's directory. This requires setuid-root.
386 Resume the first appropriate detached @code{screen} session. If
387 successful, all other command-line options are ignored. If no detached
388 session exists, start a new session using the specified options, just as
389 if @samp{-R} had not been specified. This option is set by default if
390 screen is run as a login-shell (actually screen uses @samp{-xRR} in
392 For combinations with the
393 @samp{-D}/@samp{-d} option see there.
395 @item -s @var{program}
396 Set the default shell to be @var{program}. By default, @code{screen}
397 uses the value of the environment variable @code{$SHELL}, or
398 @file{/bin/sh} if it is not defined. This option is equivalent to the
399 @code{shell} command (@pxref{Shell}).
401 @item -S @var{sessionname}
402 Set the name of the new session to @var{sessionname}. This option can
403 be used to specify a meaningful name for the session in place of the
404 default @var{tty.host} suffix. This name identifies the session for the
405 @code{screen -list} and @code{screen -r} commands. This option is
406 equivalent to the @code{sessionname} command (@pxref{Session Name}).
409 Set the title (name) for the default shell or specified program.
410 This option is equivalent to the @code{shelltitle} command
414 Set the $TERM enviroment varible using the spcified @emph{term} as
415 opposed to the defualt setting of @code{screen}.
418 Run screen in UTF-8 mode. This option tells screen that your terminal
419 sends and understands UTF-8 encoded characters. It also sets the default
420 encoding for new windows to @samp{utf8}.
423 Print the version number.
425 @item -wipe [@var{match}]
426 List available screens like @code{screen -ls}, but remove destroyed
427 sessions instead of marking them as @samp{dead}.
428 An unreachable session is considered dead, when its name matches either
429 the name of the local host, or the explicitly given parameter, if any.
430 See the @code{-r} flag for a description how to construct matches.
433 Attach to a session which is already attached elsewhere (multi-display
435 @code{Screen} refuses to attach from within itself.
436 But when cascading multiple screens, loops are not detected; take care.
440 Send the specified command to a running screen session. You can use
441 the @code{-d} or @code{-r} option to tell screen to look only for
442 attached or detached screen sessions. Note that this command doesn't
443 work if the session is password protected.
447 @node Customization, Commands, Invoking Screen, Top
448 @chapter Customizing @code{Screen}
449 @cindex customization
451 You can modify the default settings for @code{screen} to fit your tastes
452 either through a personal @file{.screenrc} file which contains commands
453 to be executed at startup, or on the fly using the @code{colon} command.
456 * Startup Files:: The @file{.screenrc} file.
457 * Source:: Read commands from a file.
458 * Colon:: Entering customization commands interactively.
461 @node Startup Files, Source, , Customization
462 @section The @file{.screenrc} file
465 When @code{screen} is invoked, it executes initialization commands from
466 the files @file{.screenrc} in the user's home directory and
467 @file{/usr/local/etc/screenrc}. These defaults can be overridden in the
469 For the global screenrc file @code{screen} searches for the environment
470 variable @code{$SYSSCREENRC} (this override feature may be disabled at
471 compile-time). The user specific screenrc file is
472 searched for in @code{$SCREENRC}, then
473 @file{@code{$HOME}/.screenrc}. The command line option @samp{-c}
474 specifies which file to use (@pxref{Invoking Screen}. Commands in these
475 files are used to set options, bind commands to keys, and to
476 automatically establish one or more windows at the beginning of
477 your @code{screen} session. Commands are listed one per line, with
478 empty lines being ignored. A command's arguments are separated by tabs
479 or spaces, and may be surrounded by single or double quotes. A @samp{#}
480 turns the rest of the line into a comment, except in quotes.
481 Unintelligible lines are warned about and ignored. Commands may contain
482 references to environment variables. The syntax is the shell-like
483 @code{$VAR} or @code{$@{VAR@}}. Note that this causes incompatibility
484 with previous @code{screen} versions, as now the '$'-character has to be
485 protected with '\' if no variable substitution is intended. A string in
486 single-quotes is also protected from variable substitution.
488 Two configuration files are shipped as examples with your screen
489 distribution: @file{etc/screenrc} and @file{etc/etcscreenrc}. They
490 contain a number of useful examples for various commands.
492 @node Source, Colon, Startup Files, Customization
494 @deffn Command source file
496 Read and execute commands from file @var{file}. Source commands
497 may be nested to a maximum recursion level of ten. If @var{file}
498 is not an absolute path and screen is already processing a
499 source command, the parent directory of the running source
500 command file is used to search for the new command file before
501 screen's current directory.
503 Note that termcap/terminfo/termcapinfo commands only work
504 at startup and reattach time, so they must be reached via
505 the default screenrc files to have an effect.
508 @node Colon, , Source, Customization
510 Customization can also be done online, with this command:
515 Allows you to enter @file{.screenrc} command lines. Useful for
516 on-the-fly modification of key bindings, specific window creation and
517 changing settings. Note that the @code{set} keyword no longer exists,
518 as of version 3.3. Change default settings with commands starting with
519 @samp{def}. You might think of this as the @code{ex} command mode of
520 @code{screen}, with @code{copy} as its @code{vi} command mode
521 (@pxref{Copy and Paste}).
524 @node Commands, New Window, Customization, Top
527 A command in @code{screen} can either be bound to a key, invoked from a
528 screenrc file, or called from the @code{colon} prompt
529 (@pxref{Customization}). As of version 3.3, all commands can be bound
530 to keys, although some may be less useful than others.
531 For a number of real life working examples of the most important
532 commands see the files @file{etc/screenrc} and @file{etc/etcscreenrc}
533 of your screen distribution.
535 In this manual, a command definition looks like this:
538 @item -- Command: command [-n] ARG1 [ARG2] @dots{}
539 (@var{keybindings})@*
540 This command does something, but I can't remember what.
543 An argument in square brackets (@samp{[]}) is optional. Many commands
544 take an argument of @samp{on} or @samp{off}, which is indicated as
545 @var{state} in the definition.
548 * Default Key Bindings:: @code{screen} keyboard commands.
549 * Command Summary:: List of all commands.
552 @node Default Key Bindings, Command Summary, , Commands
553 @section Default Key Bindings
555 As mentioned previously, each keyboard command consists of a
556 @kbd{C-a} followed by one other character. For your convenience, all
557 commands that are bound to lower-case letters are also bound to their
558 control character counterparts (with the exception of @kbd{C-a a}; see
559 below). Thus, both @kbd{C-a c} and @kbd{C-a C-c} can be used to create
562 The following table shows the default key bindings:
567 Prompt for a window identifier and switch.
572 Present a list of all windows for selection.
575 @item @kbd{C-a 0@dots{}9, -}
576 (select 0@dots{}select 9, select -)@*
577 Switch to window number 0@dots{}9, or the blank window.
580 @item @kbd{C-a @key{Tab}}
582 Switch the input focus to the next region. @xref{Regions}.
586 Toggle to the window displayed previously. If this window does no
587 longer exist, @code{other} has the same effect as @code{next}.
592 Send the command character (C-a) to window. See @code{escape} command.
593 @xref{Command Character}.
597 Allow the user to enter a title for the current window.
598 @xref{Naming Windows}.
603 Send a break to the tty.
608 Close and reopen the tty-line.
614 Create a new window with a shell and switch to that window.
615 @xref{Screen Command}.
619 Clear the screen. @xref{Clear}.
624 Detach @code{screen} from this terminal. @xref{Detach}.
628 Detach and logout. @xref{Power Detach}.
633 Cycle flow among @samp{on}, @samp{off} or @samp{auto}. @xref{Flow}.
637 Resize the window to the current region size. @xref{Fit}.
641 Toggle visual bell mode. @xref{Bell}.
645 Write a hardcopy of the current window to the file ``hardcopy.@var{n}''.
650 Toggle logging of the current window to the file ``screenlog.@var{n}''.
656 Show info about the current window. @xref{Info}.
661 Destroy the current window. @xref{Kill}.
666 Fully refresh the current window. @xref{Redisplay}.
670 Toggle the current window's login state. @xref{Login}.
675 Repeat the last message displayed in the message line.
680 Toggle monitoring of the current window. @xref{Monitor}.
682 @item @kbd{C-a @key{SPC}}
686 Switch to the next window. @xref{Selecting}.
690 Show the number (and title) of the current window. @xref{Number}.
695 @itemx @kbd{C-a @key{BackSpace}}
697 Switch to the previous window (opposite of @kbd{C-a n}).
703 Send a ^Q (ASCII XON) to the current window. @xref{XON/XOFF}.
707 Delete all regions but the current one. @xref{Regions}.
712 Toggle the current window's line-wrap setting (turn the current window's
713 automatic margins on or off). @xref{Wrap}.
718 Send a ^S (ASCII XOFF) to the current window. @xref{XON/XOFF}.
722 Split the current region horizontally into two new ones. @xref{Regions}.
727 Show the load average and xref. @xref{Time}.
731 Display the version and compilation date. @xref{Version}.
735 Enter digraph. @xref{Digraph}.
740 Show a list of active windows. @xref{Windows}.
744 Toggle between 80 and 132 columns. @xref{Window Size}.
749 Lock your terminal. @xref{Lock}.
753 Kill the current region. @xref{Regions}.
758 Suspend @code{screen}. @xref{Suspend}.
762 Reset the virtual terminal to its ``power-on'' values.
767 Write out a @file{.termcap} file. @xref{Dump Termcap}.
771 Show key bindings. @xref{Help}.
775 Kill all windows and terminate @code{screen}. @xref{Quit}.
779 Enter a command line. @xref{Colon}.
783 @itemx @kbd{C-a @key{ESC}}
785 Enter copy/scrollback mode. @xref{Copy}.
790 Write the contents of the paste buffer to the stdin queue of the
791 current window. @xref{Paste}.
796 Copy and paste a previous (command) line. @xref{History}.
800 Write the paste buffer out to the screen-exchange file.
801 @xref{Screen Exchange}.
805 Read the screen-exchange file into the paste buffer.
806 @xref{Screen Exchange}.
810 Delete the screen-exchange file. @xref{Screen Exchange}.
814 Start/stop monitoring the current window for inactivity. @xref{Silence}.
818 Split the current region vertically into two new ones. @xref{Regions}.
822 Show the copyright page. @xref{License}.
826 Show the listing of attached displays. @xref{Displays}.
829 @node Command Summary, , Default Key Bindings, Commands
830 @section Command Summary
831 @cindex command summary
834 @item acladd @var{usernames}
835 Allow other users in this session. @xref{Multiuser Session}.
836 @item aclchg @var{usernames permbits list}
837 Change a user's permissions. @xref{Multiuser Session}.
838 @item acldel @var{username}
839 Disallow other user in this session. @xref{Multiuser Session}.
840 @item aclgrp @var{usrname} [@var{groupname}]
841 Inherit permissions granted to a group leader. @xref{Multiuser Session}.
842 @item aclumask [@var{users}]+/-@var{bits} ...
843 Predefine access to new windows. @xref{Umask}.
844 @item activity @var{message}
845 Set the activity notification message. @xref{Monitor}.
846 @item addacl @var{usernames}
847 Synonym to @code{acladd}. @xref{Multiuser Session}.
848 @item allpartial @var{state}
849 Set all windows to partial refresh. @xref{Redisplay}.
850 @item altscreen @var{state}
851 Enables support for the "alternate screen" terminal capability. @xref{Redisplay}.
852 @item at [@var{ident}][@kbd{#}@var{|}@kbd{*}@var{|}@kbd{%}] @var{command} [@var{args}]
853 Execute a command at other displays or windows. @xref{At}.
854 @item attrcolor @var{attrib} [@var{attribute/color-modifier}]
855 Map attributes to colors. @xref{Attrcolor}.
856 @item autodetach @var{state}
857 Automatically detach the session on SIGHUP. @xref{Detach}.
858 @item autonuke @var{state}
859 Enable a clear screen to discard unwritten output. @xref{Autonuke}.
860 @item backtick @var{id} @var{lifespan} @var{autorefresh} @var{command} [@var{args}]
861 Define a command for the backtick string escape. @xref{Backtick}.
862 @item bce [@var{state}]
863 Change background color erase. @xref{Character Processing}.
864 @item bell_msg [@var{message}]
865 Set the bell notification message. @xref{Bell}.
866 @item bind [-c @var{class}] @var{key} [@var{command} [@var{args}]]
867 Bind a command to a key. @xref{Bind}.
868 @item bindkey [@var{opts}] [@var{string} [@var{cmd args}]]
869 Bind a string to a series of keystrokes. @xref{Bindkey}.
871 Blank the screen. @xref{Screen Saver}.
873 Define a blanker program. @xref{Screen Saver}.
874 @item break [@var{duration}]
875 Send a break signal to the current window. @xref{Break}.
876 @item breaktype [@var{tcsendbreak} | @var{TCSBRK} | @var{TIOCSBRK}]
877 Specify how to generate breaks. @xref{Break}.
878 @item bufferfile [@var{exchange-file}]
879 Select a file for screen-exchange. @xref{Screen Exchange}.
880 @item c1 [@var{state}]
881 Change c1 code processing. @xref{Character Processing}.
882 @item caption @var{mode} [@var{string}]
883 Change caption mode and string. @xref{Regions}.
884 @item chacl @var{usernames permbits list}
885 Synonym to @code{aclchg}. @xref{Multiuser Session}.
886 @item charset @var{set}
887 Change character set slot designation. @xref{Character Processing}.
888 @item chdir [@var{directory}]
889 Change the current directory for future windows. @xref{Chdir}.
891 Clear the window screen. @xref{Clear}.
893 Enter a @code{screen} command. @xref{Colon}.
894 @item command [-c @var{class}]
895 Simulate the screen escape key. @xref{Command Character}.
896 @item compacthist [@var{state}]
897 Selects compaction of trailing empty lines. @xref{Scrollback}.
898 @item console [@var{state}]
899 Grab or ungrab console output. @xref{Console}.
901 Enter copy mode. @xref{Copy}.
902 @item copy_reg [@var{key}]
903 Removed. Use @code{paste} instead. @xref{Registers}.
904 @item crlf @var{state}
905 Select line break behavior for copying. @xref{Line Termination}.
906 @item debug @var{state}
907 Suppress/allow debugging output. @xref{Debug}.
908 @item defautonuke @var{state}
909 Select default autonuke behavior. @xref{Autonuke}.
910 @item defbce @var{state}
911 Select background color erase. @xref{Character Processing}.
912 @item defbreaktype [@var{tcsendbreak} | @var{TCSBRK} | @var{TIOCSBRK}]
913 Specify the default for generating breaks. @xref{Break}.
914 @item defc1 @var{state}
915 Select default c1 processing behavior. @xref{Character Processing}.
916 @item defcharset [@var{set}]
917 Change defaul character set slot designation. @xref{Character Processing}.
918 @item defencoding @var{enc}
919 Select default window encoding. @xref{Character Processing}.
920 @item defescape @var{xy}
921 Set the default command and @code{meta} characters. @xref{Command Character}.
922 @item defflow @var{fstate}
923 Select default flow control behavior. @xref{Flow}.
924 @item defgr @var{state}
925 Select default GR processing behavior. @xref{Character Processing}.
926 @item defhstatus [@var{status}]
927 Select default window hardstatus line. @xref{Hardstatus}.
928 @item deflog @var{state}
929 Select default window logging behavior. @xref{Log}.
930 @item deflogin @var{state}
931 Select default utmp logging behavior. @xref{Login}.
932 @item defmode @var{mode}
933 Select default file mode for ptys. @xref{Mode}.
934 @item defmonitor @var{state}
935 Select default activity monitoring behavior. @xref{Monitor}.
936 @item defmousetrack @var{on}|@var{off}
937 Select the default mouse tracking behavior. @xref{Mousetrack}.
938 @item defnonblock @var{state}|@var{numsecs}
939 Select default nonblock mode. @xref{Nonblock}.
940 @item defobuflimit @var{limit}
941 Select default output buffer limit. @xref{Obuflimit}.
942 @item defscrollback @var{num}
943 Set default lines of scrollback. @xref{Scrollback}.
944 @item defshell @var{command}
945 Set the default program for new windows. @xref{Shell}.
946 @item defsilence @var{state}
947 Select default idle monitoring behavior. @xref{Silence}.
948 @item defslowpaste @var{msec}
949 Select the default inter-character timeout when pasting. @xref{Paste}.
950 @item defutf8 @var{state}
951 Select default character encoding. @xref{Character Processing}.
952 @item defwrap @var{state}
953 Set default line-wrapping behavior. @xref{Wrap}.
954 @item defwritelock @var{on|off|auto}
955 Set default writelock behavior. @xref{Multiuser Session}.
956 @item defzombie [@var{keys}]
957 Keep dead windows. @xref{Zombie}.
959 Disconnect @code{screen} from the terminal. @xref{Detach}.
960 @item digraph [@var{preset} [@var{unicode-value}]]
961 Enter a digraph sequence. @xref{Digraph}.
963 Display terminal information. @xref{Info}.
965 List currently active user interfaces. @xref{Displays}.
967 Write the window's termcap entry to a file. @xref{Dump Termcap}.
968 @item echo [-n] @var{message}
969 Display a message on startup. @xref{Startup}.
970 @item encoding @var{enc} [@var{denc}]
971 Set the encoding of a window. @xref{Character Processing}.
972 @item escape @var{xy}
973 Set the command and @code{meta} characters. @xref{Command Character}.
974 @item eval @var{command1} [@var{command2} ...]
975 Parse and execute each argument. @xref{Eval}.
976 @item exec [[@var{fdpat}] @var{command} [@var{args} ...]]
977 Run a subprocess (filter). @xref{Exec}.
979 Change window size to current display size. @xref{Window Size}.
980 @item flow [@var{fstate}]
981 Set flow control behavior. @xref{Flow}.
983 Move focus to next region. @xref{Regions}.
985 Force the current region to a certain size. @xref{Focusminsize}.
986 @item gr [@var{state}]
987 Change GR charset processing. @xref{Character Processing}.
988 @item group [@var{grouptitle}]
989 Change or show the group the current window belongs to. @xref{Window Groups}.
990 @item hardcopy [-h] [@var{file}]
991 Write out the contents of the current window. @xref{Hardcopy}.
992 @item hardcopy_append @var{state}
993 Append to hardcopy files. @xref{Hardcopy}.
994 @item hardcopydir @var{directory}
995 Place, where to dump hardcopy files. @xref{Hardcopy}.
996 @item hardstatus [@var{state}]
997 Use the hardware status line. @xref{Hardware Status Line}.
998 @item height [@var{lines} [@var{cols}]]
999 Set display height. @xref{Window Size}.
1000 @item help [-c @var{class}]
1001 Display current key bindings. @xref{Help}.
1003 Find previous command beginning @dots{}. @xref{History}.
1004 @item hstatus @var{status}
1005 Change the window's hardstatus line. @xref{Hardstatus}.
1006 @item idle [@var{timeout} [@var{cmd} @var{args}]]
1007 Define a screen saver command. @xref{Screen Saver}.
1008 @item ignorecase [@var{state}]
1009 Ignore character case in searches. @xref{Searching}.
1011 Display window settings. @xref{Info}.
1012 @item ins_reg [@var{key}]
1013 Removed, use @code{paste} instead. @xref{Registers}.
1015 Destroy the current window. @xref{Kill}.
1017 Redisplay the last message. @xref{Last Message}.
1018 @item layout new [@var{title}]
1019 Create a layout. @xref{Layout}.
1020 @item layout remove [@var{n}|@var{title}]
1021 Delete a layout. @xref{Layout}.
1023 Select the next layout. @xref{Layout}.
1025 Select the previous layout. @xref{Layout}.
1026 @item layout select [@var{n}|@var{title}]
1027 Jump to a layout. @xref{Layout}.
1029 List the available layouts. @xref{Layout}.
1030 @item layout title [@var{title}]
1031 Show or set the title of a layout. @xref{Layout}.
1032 @item layout number [@var{n}]
1033 Show or set the number of a layout. @xref{Layout}.
1034 @item layout attach [@var{title}|:last]
1035 Show or set which layout to reattach to. @xref{Layout}.
1036 @item layout save [@var{n}|@var{title}]
1037 Remember the organization of a layout. @xref{Layout}.
1038 @item layout autosave [@var{on}|@var{off}]
1039 Show or set the status of layout saving. @xref{Layout}.
1041 Display licensing information. @xref{Startup}.
1043 Lock the controlling terminal. @xref{Lock}.
1044 @item log [@var{state}]
1045 Log all output in the current window. @xref{Log}.
1046 @item logfile @var{filename}
1047 Place where to collect logfiles. @xref{Log}.
1048 @item login [@var{state}]
1049 Log the window in @file{/etc/utmp}. @xref{Login}.
1050 @item logtstamp [@var{state}]
1051 Configure logfile time-stamps. @xref{Log}.
1053 Use only the default mapping table for the next keystroke. @xref{Bindkey Control}.
1055 Don't try to do keymapping on the next keystroke. @xref{Bindkey Control}.
1056 @item maptimeout @var{n}
1057 Set the inter-character timeout used for keymapping. @xref{Bindkey Control}.
1058 @item markkeys @var{string}
1059 Rebind keys in copy mode. @xref{Copy Mode Keys}.
1060 @item maxwin @var{n}
1061 Set the maximum window number. @xref{Maxwin}.
1063 Insert the command character. @xref{Command Character}.
1064 @item monitor [@var{state}]
1065 Monitor activity in window. @xref{Monitor}.
1066 @item mousetrack [@var{on}|@var{off}]
1067 Enable selecting splitted regions with mouse clicks. @xref{Mousetrack}.
1068 @item msgminwait @var{sec}
1069 Set minimum message wait. @xref{Message Wait}.
1070 @item msgwait @var{sec}
1071 Set default message wait. @xref{Message Wait}.
1072 @item multiuser @var{state}
1073 Go into single or multi user mode. @xref{Multiuser Session}.
1074 @item nethack @var{state}
1075 Use @code{nethack}-like error messages. @xref{Nethack}.
1077 Switch to the next window. @xref{Selecting}.
1078 @item nonblock [@var{state}|@var{numsecs}]
1079 Disable flow control to the current display. @xref{Nonblock}.|@var{numsecs}]
1080 @item number [@var{n}]
1081 Change/display the current window's number. @xref{Number}.
1082 @item obuflimit [@var{limit}]
1083 Select output buffer limit. @xref{Obuflimit}.
1085 Kill all other regions. @xref{Regions}.
1087 Switch to the window you were in last. @xref{Selecting}.
1088 @item partial @var{state}
1089 Set window to partial refresh. @xref{Redisplay}.
1090 @item password [@var{crypted_pw}]
1091 Set reattach password. @xref{Detach}.
1092 @item paste [@var{src_regs} [@var{dest_reg}]]
1093 Paste contents of paste buffer or registers somewhere. @xref{Paste}.
1094 @item pastefont [@var{state}]
1095 Include font information in the paste buffer. @xref{Paste}.
1097 Close and Reopen the window's terminal. @xref{Break}.
1099 Detach and hang up. @xref{Power Detach}.
1100 @item pow_detach_msg [@var{message}]
1101 Set message displayed on @code{pow_detach}. @xref{Power Detach}.
1103 Switch to the previous window. @xref{Selecting}.
1104 @item printcmd [@var{cmd}]
1105 Set a command for VT100 printer port emulation. @xref{Printcmd}.
1106 @item process [@var{key}]
1107 Treat a register as input to @code{screen}. @xref{Registers}.
1109 Kill all windows and exit. @xref{Quit}.
1110 @item readbuf [-e @var{encoding}] [@var{filename}]
1111 Read the paste buffer from the screen-exchange file. @xref{Screen Exchange}.
1112 @item readreg [-e @var{encoding}] [@var{reg} [@var{file}]]
1113 Load a register from paste buffer or file. @xref{Registers}.
1115 Redisplay the current window. @xref{Redisplay}.
1116 @item register [-e @var{encoding}] @var{key} @var{string}
1117 Store a string to a register. @xref{Registers}.
1119 Kill current region. @xref{Regions}.
1121 Delete the screen-exchange file. @xref{Screen Exchange}.
1122 @item rendition bell | monitor | so @var{attr} [@var{color}]
1123 Change text attributes in caption for flagged windows. @xref{Rendition}.
1125 Reset the terminal settings for the window. @xref{Reset}.
1126 @item resize [(+/-)lines]
1127 Grow or shrink a region
1128 @item screen [@var{opts}] [@var{n}] [@var{cmd} [@var{args}] | //group]
1129 Create a new window. @xref{Screen Command}.
1130 @item scrollback @var{num}
1131 Set size of scrollback buffer. @xref{Scrollback}.
1132 @item select [@var{n}|-|.]
1133 Switch to a specified window. @xref{Selecting}.
1134 @item sessionname [@var{name}]
1135 Name this session. @xref{Session Name}.
1136 @item setenv [@var{var} [@var{string}]]
1137 Set an environment variable for new windows. @xref{Setenv}.
1138 @item setsid @var{state}
1139 Controll process group creation for windows. @xref{Setsid}.
1140 @item shell @var{command}
1141 Set the default program for new windows. @xref{Shell}.
1142 @item shelltitle @var{title}
1143 Set the default name for new windows. @xref{Shell}.
1144 @item silence [@var{state}|@var{seconds}]
1145 Monitor a window for inactivity. @xref{Silence}.
1146 @item silencewait @var{seconds}
1147 Default timeout to trigger an inactivity notify. @xref{Silence}.
1148 @item sleep @var{num}
1149 Pause during startup. @xref{Startup}.
1150 @item slowpaste @var{msec}
1151 Slow down pasting in windows. @xref{Paste}.
1152 @item source @var{file}
1153 Run commands from a file. @xref{Source}.
1154 @item sorendition [@var{attr} [@var{color}]]
1155 Deprecated. Use @code{rendition so} instead. @xref{Rendition}.
1157 Split region into two parts. @xref{Regions}.
1158 @item startup_message @var{state}
1159 Display copyright notice on startup. @xref{Startup}.
1160 @item stuff @var{string}
1161 Stuff a string in the input buffer of a window. @xref{Paste}.
1162 @item su [@var{username} [@var{password} [@var{password2}]]]
1163 Identify a user. @xref{Multiuser Session}.
1165 Put session in background. @xref{Suspend}.
1166 @item term @var{term}
1167 Set @code{$TERM} for new windows. @xref{Term}.
1168 @item termcap @var{term} @var{terminal-tweaks} [@var{window-tweaks}]
1169 Tweak termcap entries for best performance. @xref{Termcap Syntax}.
1170 @item terminfo @var{term} @var{terminal-tweaks} [@var{window-tweaks}]
1171 Ditto, for terminfo systems. @xref{Termcap Syntax}.
1172 @item termcapinfo @var{term} @var{terminal-tweaks} [@var{window-tweaks}]
1173 Ditto, for both systems. @xref{Termcap Syntax}.
1174 @item time [@var{string}]
1175 Display time and load average. @xref{Time}.
1176 @item title [@var{windowtitle}]
1177 Set the name of the current window. @xref{Title Command}.
1178 @item umask [@var{users}]+/-@var{bits} ...
1179 Synonym to @code{aclumask}. @xref{Umask}.
1181 Unset all keybindings. @xref{Bind}.
1182 @item unsetenv @var{var}
1183 Unset environment variable for new windows. @xref{Setenv}.
1184 @item utf8 [@var{state} [@var{dstate}]]
1185 Select character encoding of the current window. @xref{Character Processing}.
1186 @item vbell [@var{state}]
1187 Use visual bell. @xref{Bell}.
1188 @item vbell_msg [@var{message}]
1189 Set vbell message. @xref{Bell}.
1190 @item vbellwait @var{sec}
1191 Set delay for vbell message. @xref{Bell}.
1193 Display @code{screen} version. @xref{Version}.
1194 @item wall @var{message}
1195 Write a message to all displays. @xref{Multiuser Session}.
1196 @item width [@var{cols} [@var{lines}]]
1197 Set the width of the window. @xref{Window Size}.
1198 @item windowlist [[-b] [-m] [-g]] | string [@var{string}] | title [@var{title}]
1199 Present a list of all windows for selection. @xref{Windowlist}.
1201 List active windows. @xref{Windows}.
1202 @item wrap [@var{state}]
1203 Control line-wrap behavior. @xref{Wrap}.
1204 @item writebuf [-e @var{encoding}] [@var{filename}]
1205 Write paste buffer to screen-exchange file. @xref{Screen Exchange}.
1206 @item writelock @var{on}|@var{off}|@var{auto}
1207 Grant exclusive write permission. @xref{Multiuser Session}.
1209 Send an XOFF character. @xref{XON/XOFF}.
1211 Send an XON character. @xref{XON/XOFF}.
1212 @item zmodem [off|auto|catch|pass]
1213 Define how screen treats zmodem requests. @xref{Zmodem}.
1214 @item zombie [@var{keys} [onerror] ]
1215 Keep dead windows. @xref{Zombie}.
1218 @node New Window, Selecting, Commands, Top
1221 This section describes the commands for creating a new window for
1222 running programs. When a new window is created, the first available
1223 number is assigned to it.
1224 The number of windows is limited at compile-time by the MAXWIN
1225 configuration parameter (which defaults to 40).
1228 * Chdir:: Change the working directory for new windows.
1229 * Screen Command:: Create a new window.
1230 * Setenv:: Set environment variables for new windows.
1231 * Shell:: Parameters for shell windows.
1232 * Term:: Set the terminal type for new windows.
1233 * Window Types:: Creating different types of windows.
1234 * Window Groups:: Grouping windows together
1237 @node Chdir, Screen Command, , New Window
1239 @deffn Command chdir [directory]
1241 Change the current directory of @code{screen} to the specified directory
1242 or, if called without an argument, to your home directory (the value of
1243 the environment variable @code{$HOME}). All windows that are created by means
1244 of the @code{screen} command from within @file{.screenrc} or by means of
1245 @kbd{C-a : screen @dots{}} or @kbd{C-a c} use this as their default
1246 directory. Without a @code{chdir} command, this would be the directory
1247 from which @code{screen} was invoked. Hardcopy and log files are always
1248 written to the @emph{window's} default directory, @emph{not} the current
1249 directory of the process running in the window. You can use this
1250 command multiple times in your @file{.screenrc} to start various windows
1251 in different default directories, but the last @code{chdir} value will
1252 affect all the windows you create interactively.
1255 @node Screen Command, Setenv, Chdir, New Window
1256 @section Screen Command
1259 @deffn Command screen [opts] [n] [cmd [args] @var{| //group}]
1260 (@kbd{C-a c}, @kbd{C-a C-c})@*
1261 Establish a new window. The flow-control options (@samp{-f}, @samp{-fn}
1262 and @samp{-fa}), title option (@samp{-t}), login options
1263 (@samp{-l} and @samp{-ln}) , terminal type option (@samp{-T @var{term}}),
1264 the all-capability-flag (@samp{-a}) and scrollback option
1265 (@samp{-h @var{num}}) may be specified with each command.
1266 The option (@samp{-M}) turns monitoring on for this window.
1267 The option (@samp{-L}) turns output logging on for this window.
1268 If an optional number @var{n} in the range 0@dots{}MAXWIN-1 is given,
1269 the window number @var{n} is assigned to the newly created window (or,
1270 if this number is already in-use, the next available number). If a
1271 command is specified after @code{screen}, this command (with the given
1272 arguments) is started in the window; otherwise, a shell is created.
1273 If @samp{//group} is supplied, a container-type window is created in
1274 which other windows may be created inside it. @xref{Window Groups}.
1276 Screen has built in some functionality of @samp{cu} and @samp{telnet}.
1277 @xref{Window Types}.
1280 Thus, if your @file{.screenrc} contains the lines
1283 # example for .screenrc:
1285 screen -fn -t foobar 2 -L telnet foobar
1289 @code{screen} creates a shell window (in window #1) and a window with a
1290 TELNET connection to the machine foobar (with no flow-control using the
1291 title @samp{foobar} in window #2) and will write a logfile @samp{screenlog.2}
1292 of the telnet session. If you do not include any
1293 @code{screen} commands in your @file{.screenrc} file, then @code{screen}
1294 defaults to creating a single shell window, number zero. When the
1295 initialization is completed, @code{screen} switches to the last window
1296 specified in your .screenrc file or, if none, it opens default window
1299 @node Setenv, Shell, Screen Command, New Window
1301 @deffn Command setenv var string
1303 Set the environment variable @var{var} to value @var{string}.
1304 If only @var{var} is specified, the user will be prompted to enter a value.
1305 If no parameters are specified, the user will be prompted for both variable
1306 and value. The environment is inherited by all subsequently forked shells.
1309 @deffn Command unsetenv var
1311 Unset an environment variable.
1314 @node Shell, Term, Setenv, New Window
1316 @deffn Command shell command
1317 @deffnx Command defshell command
1319 Set the command to be used to create a new shell. This overrides the
1320 value of the environment variable @code{$SHELL}. This is useful if
1321 you'd like to run a tty-enhancer which is expecting to execute the
1322 program specified in @code{$SHELL}. If the command begins with
1323 a @samp{-} character, the shell will be started as a login-shell.
1325 @code{defshell} is currently a synonym to the @code{shell} command.
1328 @deffn Command shelltitle title
1330 Set the title for all shells created during startup or by the C-a C-c
1331 command. @xref{Naming Windows}, for details about what titles are.
1334 @node Term, Window Types , Shell, New Window
1336 @deffn Command term term
1338 In each window @code{screen} opens, it sets the @code{$TERM}
1339 variable to @code{screen} by default, unless no description for
1340 @code{screen} is installed in the local termcap or terminfo data base.
1341 In that case it pretends that the terminal emulator is @samp{vt100}.
1342 This won't do much harm, as @code{screen} is VT100/ANSI compatible. The
1343 use of the @code{term} command is discouraged for non-default purpose.
1344 That is, one may want to specify special @code{$TERM} settings (e.g. vt100) for
1345 the next @code{screen rlogin othermachine} command. Use the command
1346 @code{screen -T vt100 rlogin othermachine} rather than setting
1347 and resetting the default.
1350 @node Window Types, Window Groups, Term, New Window
1351 @section Window Types
1352 @cindex window types
1353 Screen provides three different window types. New windows are created
1354 with @code{screen}'s @samp{screen} command (@pxref{Screen Command}).
1355 The first parameter to the @samp{screen} command defines which
1356 type of window is created. The different window types are all
1357 special cases of the normal type. They have been added in order
1358 to allow @code{screen} to be used efficiently as a console
1359 with 100 or more windows.
1362 The normal window contains a shell (default, if no parameter is given)
1363 or any other system command that could be executed from a shell.
1364 (e.g. @samp{slogin}, etc...).
1367 If a tty (character special device) name (e.g. @samp{/dev/ttya})
1368 is specified as the first parameter, then the window is directly
1369 connected to this device.
1370 This window type is similar to @samp{screen cu -l /dev/ttya}.
1371 Read and write access is required on the device node,
1372 an exclusive open is attempted on the node to mark the connection line
1374 An optional parameter is allowed consisting of a comma separated
1375 list of flags in the notation used by @samp{stty(1)}:
1378 Usually 300, 1200, 9600 or 19200. This affects transmission as well as
1381 Specify the transmission of eight (or seven) bits per byte.
1383 Enables (or disables) software flow-control (CTRL-S/CTRL-Q) for sending
1385 @item ixoff or -ixoff
1386 Enables (or disables) software flow-control for receiving data.
1387 @item istrip or -istrip
1388 Clear (or keep) the eight bit in each received byte.
1391 You may want to specify as many of these options as applicable.
1392 Unspecified options cause the terminal driver to make up the parameter
1393 values of the connection. These values are system-dependent and may be
1394 in defaults or values saved from a previous connection.
1396 For tty windows, the @code{info} command shows some of the modem
1397 control lines in the status line.
1398 These may include @samp{RTS}, @samp{CTS}, @samp{DTR}, @samp{CD} and
1399 more. This depends rather on on the available @code{ioctl()}'s and system
1400 header files than on the physical capabilities of the serial board.
1401 The name of a logical low (inactive) signal is preceded by an
1402 exclamation mark (@samp{!}), otherwise the signal is logical high (active).
1403 Unsupported but shown signals are usually shown low.
1404 When the @code{CLOCAL} status bit is true, the whole set of modem signals is
1405 placed inside curly braces (@samp{@{} and @samp{@}}).
1406 When the @code{CRTSCTS} or @code{TIOCSOFTCAR} bit is true, the signals
1407 @samp{CTS} or @samp{CD} are shown in parenthesis, respectively.
1409 For tty windows, the command @code{break} causes the Data transmission
1410 line (TxD) to go low for a specified period of time. This is expected
1411 to be interpreted as break signal on the other side.
1412 No data is sent and no modem control line is changed when a
1413 @code{break} is issued.
1416 If the first parameter is @code{//telnet}, the second parameter is
1417 expected to be a host name, and an optional third parameter may specify
1418 a TCP port number (default decimal 23). Screen will connect to a
1419 server listening on the remote host and use the telnet protocol to
1420 communicate with that server.
1422 For telnet windows, the command @code{info} shows details about
1423 the connection in square brackets (@samp{[} and @samp{]}) at the end of
1427 BINARY. The connection is in binary mode.
1429 ECHO. Local echo is disabled.
1431 SGA. The connection is in `character mode' (default: `line mode').
1433 TTYPE. The terminal type has been requested by the remote host. Screen
1434 sends the name @code{screen} unless instructed otherwise (see also the
1435 command @samp{term}).
1437 NAWS. The remote site is notified about window size changes.
1439 LFLOW. The remote host will send flow control information.
1440 (Ignored at the moment.)
1442 Additional flags for debugging are @samp{x}, @samp{t} and @samp{n}
1443 (XDISPLOC, TSPEED and NEWENV).
1445 For telnet windows, the command @code{break} sends the telnet code
1446 @code{IAC BREAK} (decimal 243) to the remote host.
1450 @node Window Groups, , Window Types, New Window
1451 @section Window Groups
1452 @cindex window groups
1453 Screen provides a method for grouping windows together. Windows can be
1454 organized in a heirarchial fashion, resembling a tree structure. New
1455 screens are created using the @code{screen} command while new groups
1456 are created using @code{screen //group}. @xref{Screen Command}.
1458 Once a new group is created, it will act as a container for windows
1459 and even other groups. When a group is selected, you will see the
1460 output of the @code{windowlist} command, allowing you to select a
1461 window inside. If there are no windows inside a group, use the
1462 @code{screen} command to create one. Once inside a group, using the
1463 commands @code{next} and @code{prev} will switch between windows only
1464 in that group. Using the @code{windowlist} command will give you the
1465 opportunity to leave the group you are in. @xref{Windowlist}.
1467 @deffn Command group [grouptitle]
1468 Change or show the group the current window belongs to. Windows can
1469 be moved around between different groups by specifying the name of
1470 the destination group. Without specifying a group, the title of the
1471 current group is displayed.
1474 Using groups in combination with layouts will help create a
1475 multi-desktop experience. One group can be assigned for each
1476 layout made. Windows can be made, split, and organized within each
1477 group as desired. Afterwhich, switching between groups can be as easy
1478 as switching layouts.
1480 @node Selecting, Session Management, New Window, Top
1481 @chapter Selecting a Window
1483 This section describes the commands for switching between windows in an
1484 @code{screen} session. The windows are numbered from 0 to 9, and are created
1485 in that order by default (@pxref{New Window}).
1488 * Next and Previous:: Forward or back one window.
1489 * Other Window:: Switch back and forth between two windows.
1490 * Select:: Switch to a window (and to one after @code{kill}).
1491 * Windowlist:: Present a list of all windows for selection.
1494 @node Next and Previous, Other Window, , Selecting
1495 @section Moving Back and Forth
1500 (@kbd{C-a @key{SPC}}, @kbd{C-a n}, @kbd{C-a C-n})@*
1501 Switch to the next window. This command can be used repeatedly to
1502 cycle through the list of windows. (On some terminals, C-@key{SPC}
1503 generates a NUL character, so you must release the control key before
1512 (@kbd{C-a p}, @kbd{C-a C-p}, @kbd{C-a C-h}, @kbd{C-a @key{Backspace}})@*
1513 Switch to the previous window (the opposite of @kbd{C-a n}).
1516 @node Other Window, Select, Next and Previous, Selecting
1517 @section Other Window
1519 @deffn Command other
1521 Switch to the last window displayed. Note that this command
1522 defaults to the command character typed twice, unless overridden.
1523 For instance, if you use the option @samp{-e]x},
1524 this command becomes @kbd{]]} (@pxref{Command Character}).
1527 @node Select, Windowlist, Other Window, Selecting
1531 @deffn Command select [n @var{|-|.}]
1532 (@kbd{C-a @var{n}}, @kbd{C-a '})@*
1533 Switch to the window with the number @var{n}.
1534 If no window number is specified, you get prompted for an
1535 identifier. This can be a window name (title) or a number.
1536 When a new window is established, the lowest available number
1537 is assigned to this window.
1538 Thus, the first window can be activated by @code{select 0}; there
1539 can be no more than 10 windows present simultaneously (unless screen is
1540 compiled with a higher MAXWIN setting).
1541 There are two special arguments, @code{select -} switches to the
1542 internal blank window and @code{select .} switches to the
1543 current window. The latter is useful if used with screen's
1548 @node Windowlist, , Select, Selecting
1551 @deffn Command windowlist [-b] [-m] [-g]
1552 @deffnx Command windowlist string [@var{string}]
1553 @deffnx Command windowlist title [@var{title}]
1555 Display all windows in a table for visual window selection.
1556 The desired window can be selected via the standard
1557 movement keys (@pxref{Movement}) and activated via
1558 the return key. If screen was in a window group, screen will
1559 back out of the group and then display the windows in that
1560 group. If the @code{-b} option is given, screen will
1561 switch to the blank window before presenting the list, so
1562 that the current window is also selectable.
1563 The @code{-m} option changes the order of the windows, instead of
1564 sorting by window numbers screen uses its internal most-recently-used
1565 list. The @code{-g} option will show the windows inside any groups
1566 in that level and downwards.
1568 The table format can be changed with the string and title
1569 option, the title is displayed as table heading, while the
1570 lines are made by using the string setting. The default
1571 setting is @samp{Num Name%=Flags} for the title and
1572 @samp{%3n %t%=%f} for the lines. See the string escapes chapter
1573 (@pxref{String Escapes}) for more codes (e.g. color settings).
1577 @node Session Management, Regions, Selecting, Top
1578 @chapter Session Management Commands
1580 Perhaps the most useful feature of @code{screen} is the way it allows
1581 the user to move a session between terminals, by detaching and
1582 reattaching. This also makes life easier for modem users who have to
1583 deal with unexpected loss of carrier.
1586 * Detach:: Disconnect @code{screen} from your terminal.
1587 * Power Detach:: Detach and log out.
1588 * Lock:: Lock your terminal temporarily.
1589 * Multiuser Session:: Changing number of allowed users.
1590 * Session Name:: Rename your session for later reattachment.
1591 * Suspend:: Suspend your session.
1592 * Quit:: Terminate your session.
1595 @node Detach, Power Detach, , Session Management
1598 @deffn Command autodetach state
1600 Sets whether @code{screen} will automatically detach upon hangup, which
1601 saves all your running programs until they are resumed with a
1602 @code{screen -r} command. When turned off, a hangup signal will
1603 terminate @code{screen} and all the processes it contains. Autodetach is
1609 @deffn Command detach
1610 (@kbd{C-a d}, @kbd{C-a C-d})@*
1611 Detach the @code{screen} session (disconnect it from the terminal and
1612 put it into the background). A detached @code{screen} can be resumed by
1613 invoking @code{screen} with the @code{-r} option (@pxref{Invoking
1615 The @code{-h} option tells screen to immediately close the connection
1616 to the terminal (@samp{hangup}).
1619 @deffn Command password [crypted_pw]
1621 Present a crypted password in your @file{.screenrc} file and screen will
1622 ask for it, whenever someone attempts to resume a detached session. This
1623 is useful, if you have privileged programs running under @code{screen}
1624 and you want to protect your session from reattach attempts by users
1625 that managed to assume your uid. (I.e. any superuser.) If no crypted
1626 password is specified, screen prompts twice a password and places its
1627 encryption in the paste buffer. Default is `none', which disables
1631 @node Power Detach, Lock, Detach, Session Management
1632 @section Power Detach
1635 @deffn Command pow_detach
1637 Mainly the same as @code{detach}, but also sends a HANGUP signal
1638 to the parent process of @code{screen}.@*
1639 @emph{Caution}: This will result in a
1640 logout if @code{screen} was started from your login shell.
1643 @deffn Command pow_detach_msg [message]
1645 The @var{message} specified here is output whenever a power detach is
1646 performed. It may be used as a replacement for a logout message or to reset
1648 Without a parameter, the current message is shown.
1651 @node Lock, Multiuser Session, Power Detach, Session Management
1655 @deffn Command lockscreen
1656 (@kbd{C-a x}, @kbd{C-a C-x})@*
1657 Call a screenlock program (@file{/local/bin/lck} or @file{/usr/bin/lock}
1658 or a builtin, if no other is available). Screen does not accept any
1659 command keys until this program terminates. Meanwhile processes in the
1660 windows may continue, as the windows are in the detached state.
1661 The screenlock program may be changed through the environment variable
1662 @code{$LOCKPRG} (which must be set in the shell from which @code{screen}
1663 is started) and is executed with the user's uid and gid.
1665 Warning: When you leave other shells unlocked and have no password set
1666 on @code{screen}, the lock is void: One could easily re-attach from an
1667 unlocked shell. This feature should rather be called
1668 @code{lockterminal}.
1671 @node Multiuser Session, Session Name, Lock, Session Management
1672 @section Multiuser Session
1673 @cindex multiuser session
1675 These commands allow other users to gain access to one single @code{screen}
1676 session. When attaching to a multiuser @code{screen} the sessionname is
1677 specified as @code{username/sessionname} to the @code{-S} command line option.
1678 @code{Screen} must be compiled with multiuser support to enable features
1682 * Multiuser:: Enable / Disable multiuser mode.
1683 * Acladd:: Enable a specific user.
1684 * Aclchg:: Change a users permissions.
1685 * Acldel:: Disable a specific user.
1686 * Aclgrp:: Grant a user permissions to other users.
1687 * Displays:: List all active users at their displays.
1688 * Umask:: Predefine access to new windows.
1689 * Wall:: Write a message to all users.
1690 * Writelock:: Grant exclusive window access.
1691 * Su:: Substitute user.
1694 @node Multiuser, Acladd, , Multiuser Session
1695 @subsection Multiuser
1696 @deffn Command multiuser @var{state}
1698 Switch between single-user and multi-user mode. Standard screen operation is
1699 single-user. In multi-user mode the commands @code{acladd}, @code{aclchg} and
1700 @code{acldel} can be used to enable (and disable) other users accessing this
1704 @node Acladd, Aclchg, Multiuser, Multiuser Session
1706 @deffn Command acladd @var{usernames}
1707 @deffnx Command addacl @var{usernames}
1709 Enable users to fully access this screen session. @var{Usernames} can be one
1710 user or a comma separated list of users. This command enables to attach to
1711 the @code{screen} session and performs the equivalent of
1712 @code{aclchg @var{usernames} +rwx "#?"}. To add a user with restricted access,
1713 use the @code{aclchg} command below.
1714 @code{Addacl} is a synonym to @code{acladd}.
1715 Multi-user mode only.
1718 @node Aclchg, Acldel, Acladd, Multiuser Session
1720 @deffn Command aclchg @var{usernames permbits list}
1721 @deffnx Command chacl @var{usernames permbits list}
1723 Change permissions for a comma separated list of users.
1724 Permission bits are represented as @samp{r}, @samp{w} and @samp{x}.
1725 Prefixing @samp{+} grants the permission, @samp{-} removes it. The third
1726 parameter is a comma separated list of commands or windows (specified either
1727 by number or title). The special list @samp{#} refers to all windows, @samp{?}
1728 to all commands. If @var{usernames} consists of a single @samp{*}, all
1729 known users are affected.
1730 A command can be executed when the user has the @samp{x} bit for it. The user
1731 can type input to a window when he has its @samp{w} bit set and no other
1732 user obtains a writelock for this window. Other bits are currently ignored.
1733 To withdraw the writelock from another user in e.g. window 2:
1734 @samp{aclchg @var{username} -w+w 2}. To allow read-only access
1735 to the session: @samp{aclchg @var{username} -w "#"}. As soon as a user's name
1736 is known to screen, he can attach to the session and (per default) has full
1737 permissions for all command and windows. Execution permission for the acl
1738 commands, @code{at} and others should also be removed or the user may be able
1739 to regain write permission.
1740 @code{Chacl} is a synonym to @code{aclchg}.
1741 Multi-user mode only.
1744 @node Acldel, Aclgrp, Aclchg, Multiuser Session
1746 @deffn Command acldel @var{username}
1748 Remove a user from screen's access control list. If currently attached, all the
1749 user's displays are detached from the session. He cannot attach again.
1750 Multi-user mode only.
1753 @node Aclgrp, Displays, Acldel, Multiuser Session
1755 @deffn Command aclgrp @var{username} [@var{groupname}]
1757 Creates groups of users that share common access rights. The
1758 name of the group is the username of the group leader. Each
1759 member of the group inherits the permissions that are
1760 granted to the group leader. That means, if a user fails an
1761 access check, another check is made for the group leader.
1762 A user is removed from all groups the special value @samp{none}
1763 is used for @var{groupname}. If the second parameter is omitted
1764 all groups the user is in are listed.
1767 @node Displays, Umask, Aclgrp, Multiuser Session
1768 @subsection Displays
1770 @deffn Command displays
1772 Shows a tabular listing of all currently connected user
1773 front-ends (displays). This is most useful for multiuser
1777 @node Umask, Wall, Displays, Multiuser Session
1778 @subsection aclumask
1779 @deffn Command aclumask [@var{users}]+/-@var{bits} ...
1780 @deffnx Command umask [@var{users}]+/-@var{bits} ...
1782 This specifies the access other users have to windows that
1783 will be created by the caller of the command. @var{Users} may be no,
1784 one or a comma separated list of known usernames. If no users are
1785 specified, a list of all currently known users is assumed.
1786 @var{Bits} is any combination of access control bits allowed
1787 defined with the @code{aclchg} command. The special username @samp{?}
1788 predefines the access that not yet known users will be
1789 granted to any window initially. The special username @samp{??}
1790 predefines the access that not yet known users are granted
1791 to any command. Rights of the special username nobody cannot
1792 be changed (see the @code{su} command).
1793 @code{Umask} is a synonym to @code{aclumask}.
1797 @node Wall, Writelock, Umask, Multiuser Session
1799 @deffn Command wall @var{message}
1801 Write a message to all displays. The message will appear in the terminal's
1805 @node Writelock, Su , Wall, Multiuser Session
1806 @subsection Writelock
1807 @deffn Command writelock @var{on|off|auto}
1809 In addition to access control lists, not all users may be able to write to
1810 the same window at once. Per default, writelock is in @samp{auto} mode and
1811 grants exclusive input permission to the user who is the first to switch
1812 to the particular window. When he leaves the window, other users may obtain
1813 the writelock (automatically). The writelock of the current window is disabled
1814 by the command @code{writelock off}. If the user issues the command
1815 @code{writelock on} he keeps the exclusive write permission while switching
1819 @deffn Command defwritelock @var{on|off|auto}
1821 Sets the default writelock behavior for new windows. Initially all windows
1822 will be created with no writelocks.
1825 @node Su, , Writelock, Multiuser Session
1827 @deffn Command su [@var{username} [@var{password} [@var{password2}]]]
1829 Substitute the user of a display. The command prompts for
1830 all parameters that are omitted. If passwords are specified
1831 as parameters, they have to be specified un-crypted. The
1832 first password is matched against the systems passwd database,
1833 the second password is matched against the @code{screen}
1834 password as set with the commands @code{acladd} or @code{password}.
1835 @code{Su} may be useful for the @code{screen} administrator to test
1837 When the identification fails, the user has
1838 access to the commands available for user @samp{nobody}. These are
1839 @code{detach}, @code{license}, @code{version}, @code{help} and
1843 @node Session Name, Suspend, Multiuser Session, Session Management
1844 @section Session Name
1845 @deffn Command sessionname [@var{name}]
1847 Rename the current session. Note that for @code{screen -list} the name
1848 shows up with the process-id prepended. If the argument @var{name} is
1849 omitted, the name of this session is displayed.@*
1850 @emph{Caution}: The @code{$STY}
1851 environment variable will still reflect the old name in pre-existing
1852 shells. This may result in
1853 confusion. Use of this command is generally
1854 discouraged. Use the @code{-S} command-line option if you want to
1855 name a new session.The default is constructed from the tty and host names.
1858 @node Suspend, Quit, Session Name, Session Management
1862 @deffn Command suspend
1863 (@kbd{C-a z}, @kbd{C-a C-z})@*
1864 Suspend @code{screen}. The windows are in the detached state while
1865 @code{screen} is suspended. This feature relies on the parent shell
1866 being able to do job control.
1869 @node Quit, , Suspend, Session Management
1874 Kill all windows and terminate @code{screen}. Note that on VT100-style
1875 terminals the keys @kbd{C-4} and @kbd{C-\} are identical. So be careful
1876 not to type @kbd{C-a C-4} when selecting window no. 4. Use the empty
1877 bind command (as in @code{bind "^\"}) to remove a key binding
1878 (@pxref{Key Binding}).
1881 @node Regions, Window Settings, Session Management, Top
1884 Screen has the ability to display more than one window on the
1885 user's display. This is done by splitting the screen in regions,
1886 which can contain different windows.
1889 * Split:: Split a region into two
1890 * Focus:: Change to the next region
1891 * Only:: Delete all other regions
1892 * Remove:: Delete the current region
1893 * Resize:: Grow or shrink a region
1894 * Caption:: Control the window's caption
1895 * Fit:: Resize a window to fit the region
1896 * Focusminsize:: Force a minimum size on a current region
1897 * Layout:: Manage groups of regions
1900 @node Split, Focus, , Regions
1904 @deffn Command split [-v]
1905 (@kbd{C-a S}, @kbd{C-a |})@*
1906 Split the current region into two new ones. All regions on the
1907 display are resized to make room for the new region. The blank
1908 window is displayed on the new region. The default is to create
1909 a horizontal split, putting the new regions on the top and
1910 bottom of each other. Using -v will create a vertical split,
1911 causing the new regions to appear side by side of each other.
1913 With this current implementation of @code{screen}, scrolling data
1914 will appear much slower in a vertically splited region than one
1915 that is not. This should be taken into consideration if you need
1916 to use system commands such as @code{cat} or @code{tail -f}.
1919 @node Focus, Only, Split, Regions
1922 @deffn Command focus
1923 (@kbd{C-a @key{Tab}})@*
1924 Move the input focus to the next region. This is done in a cyclic
1925 way so that the top region is selected after the bottom one. If
1926 no subcommand is given it defaults to `down'. `up' cycles in the
1927 opposite order, `top' and `bottom' go to the top and bottom
1928 region respectively. Useful bindings are (j and k as in vi)
1937 @node Only, Remove, Focus, Regions
1942 Kill all regions but the current one.
1945 @node Remove, Resize, Only, Regions
1948 @deffn Command remove
1950 Kill the current region. This is a no-op if there is only one region.
1953 @node Resize, Caption, Remove, Regions
1955 @deffn Command resize [(+/-)@var{lines}]
1957 Resize the current region. The space will be removed from or added to
1958 the region below or if there's not enough space from the region above.
1960 resize +N increase current region height by N
1961 resize -N decrease current region height by N
1962 resize N set current region height to N
1963 resize = make all windows equally high
1964 resize max maximize current region height
1965 resize min minimize current region height
1969 @node Caption, Fit, Resize, Regions
1971 @deffn Command caption @code{always}|@code{splitonly} [string]
1972 @deffnx Command caption @code{string} [string]
1974 This command controls the display of the window captions. Normally
1975 a caption is only used if more than one window is shown on the
1976 display (split screen mode). But if the type is set to
1977 @code{always}, @code{screen} shows a caption
1978 even if only one window is displayed. The default
1979 is @samp{splitonly}.
1981 The second form changes the text used for the caption. You can use
1982 all string escapes (@pxref{String Escapes}). @code{Screen} uses
1983 a default of @samp{%3n %t}.
1985 You can mix both forms by providing the string as an additional
1989 @node Fit, Focusminsize, Caption, Regions
1994 Change the window size to the size of the current region. This
1995 command is needed because screen doesn't adapt the window size
1996 automatically if the window is displayed more than once.
1999 @node Focusminsize, Layout, Fit, Regions
2000 @section Focusminsize
2001 @deffn Command focusminsize [ (width|@code{max}|@code{_}) (height|@code{max}|@code{_}) ]
2003 This forces any currently selected region to be automatically
2004 resized at least a certain @var{width} and @var{height}. All
2005 other surrounding regions will be resized in order to accomodate.
2006 This constraint follows everytime the @code{focus} command is
2007 used. The @code{resize} command can be used to increase either
2008 dimension of a region, but never below what is set with
2009 @code{focusminsize}. The underscore @samp{_} is a synonym for
2010 @code{max}. Setting a @var{width} and @var{height} of @code{0 0}
2011 (zero zero) will undo any constraints and allow for manual resizing.
2012 Without any parameters, the minimum width and height is shown.
2015 @node Layout, , Focusminsize, Regions
2018 Using regions, and perhaps a large enough terminal, you can create
2019 a more of a desktop feel to @code{screen}. By being able to split
2020 regions horizontally or vertically, you can take advantage of the
2021 lesser used spaces of your terminal. The catch to these splits has
2022 been that they're not kept between screen detachments and reattachments.
2024 Layouts will help your organization of regions. You can create one
2025 layout of four horizontal regions and then create a separate layout
2026 of regions in a two by two array. The regions don't have to contain
2027 the same windows. You can easily switch between layouts and keep
2028 them between detachments and reattachments.
2030 Note that there are several subcommands to @code{layout}.
2032 @deffn Command layout @code{new} [title]
2034 Create a new layout. The screen will change to one whole region
2035 and be switched to the blank window. From here, you build the
2036 regions and the windows they show as you desire. The new layout
2037 will be numbered with the smallest available integer, starting
2038 with zero. You can optionally give a title to your new layout.
2039 Otherwise, it will have a default title of @code{layout}. You
2040 can always change the title later by using the command
2041 @code{layout title}.
2044 @deffn Command layout @code{remove} [n|title]
2046 Remove, or in other words, delete the specified layout. Either
2047 the number or the title can be specified. Without either
2048 specification, @code{screen} will remove the current layout.
2050 Removing a layout does not affect your set windows or regions.
2053 @deffn Command layout @code{next}
2055 Switch to the next layout available
2058 @deffn Command layout @code{prev}
2060 Switch to the previous layout available
2063 @deffn Command layout @code{select} [n|title]
2065 Select the desired layout. Either the number or the title can
2066 be specified. Without either specification, @code{screen} will
2067 prompt and ask which screen is desired. To see which layouts are
2068 available, use the @code{layout show} command.
2071 @deffn Command layout @code{show}
2073 List on the message line the number(s) and title(s) of the available
2074 layout(s). The current layout is flagged.
2077 @deffn Command layout @code{title} [title]
2079 Change or display the title of the current layout. A string given
2080 will be used to name the layout. Without any options, the current
2081 title and number is displayed on the message line.
2084 @deffn Command layout @code{number} [n]
2086 Change or display the number of the current layout. An integer given
2087 will be used to number the layout. Without any options, the current
2088 number and title is displayed on the message line.
2091 @deffn Command layout @code{attach} [title|@code{:last}]
2093 Change or display which layout to reattach back to. The default is
2094 @code{:last}, which tells @code{screen} to reattach back to the last
2095 used layout just before detachment. By supplying a title, You can
2096 instruct @code{screen} to reattach to a particular layout regardless
2097 which one was used at the time of detachment. Without any options,
2098 the layout to reattach to will be shown in the message line.
2101 @deffn Command layout @code{save} [n|title]
2103 Remember the current arrangement of regions. When used, @code{screen}
2104 will remember the arrangement of vertically and horizontally split
2105 regions. This arrangement is restored when a @code{screen} session
2106 is reattached or switched back from a different layout. If a number
2107 or title is supplied, @code{screen} will remember the arrangement of
2108 that particular layout. Without any options, @code{screen} will
2109 remember the current layout.
2111 Saving your regions can be done automatically by using the
2112 @code{layout autosave} command.
2115 @deffn Command layout @code{autosave} [@code{on}|@code{off}]
2117 Change or display the status of automatcally saving layouts. The
2118 default is @code{on}, meaning when @code{screen} is detached or
2119 changed to a different layout, the arrangement of regions and windows
2120 will be remembered at the time of change and restored upon return.
2121 If autosave is set to @code{off}, that arrangement will only be
2122 restored to either to the last manual save, using @code{layout save},
2123 or to when the layout was first created, to a single region with
2124 a single window. Without either an @code{on} or an @code{off}, the
2125 current status is displayed on the message line.
2129 @node Window Settings, Virtual Terminal, Regions, Top
2130 @chapter Window Settings
2132 These commands control the way @code{screen} treats individual windows
2133 in a session. @xref{Virtual Terminal}, for commands to control the
2134 terminal emulation itself.
2137 * Naming Windows:: Control the name of the window
2138 * Console:: See the host's console messages
2139 * Kill:: Destroy an unwanted window
2140 * Login:: Control @file{/etc/utmp} logging
2141 * Mode:: Control the file mode of the pty
2142 * Monitor:: Watch for activity in a window
2143 * Windows:: List the active windows
2144 * Hardstatus:: Set a window's hardstatus line
2147 @node Naming Windows, Console, , Window Settings
2148 @section Naming Windows (Titles)
2151 You can customize each window's name in the window display (viewed with
2152 the @code{windows} command (@pxref{Windows}) by setting it with
2153 one of the title commands. Normally the name displayed is the actual
2154 command name of the program created in the window. However, it is
2155 sometimes useful to distinguish various programs of the same name or to
2156 change the name on-the-fly to reflect the current state of the window.
2158 The default name for all shell windows can be set with the
2159 @code{shelltitle} command (@pxref{Shell}). You can specify the name you
2160 want for a window with the @samp{-t} option to the @code{screen} command
2161 when the window is created (@pxref{Screen Command}). To change the name after
2162 the window has been created you can use the title-string escape-sequence
2163 (@kbd{@key{ESC} k @var{name} @key{ESC} \}) and the @code{title} command
2164 (C-a A). The former can be output from an application to control the
2165 window's name under software control, and the latter will prompt for a
2166 name when typed. You can also bind predefined names to keys with the
2167 @code{title} command to set things quickly without prompting.
2170 * Title Command:: The @code{title} command.
2171 * Dynamic Titles:: Make shell windows change titles dynamically.
2172 * Title Prompts:: Set up your shell prompt for dynamic Titles.
2173 * Title Screenrc:: Set up Titles in your @file{.screenrc}.
2176 @node Title Command, Dynamic Titles, , Naming Windows
2177 @subsection Title Command
2179 @deffn Command title [windowtitle]
2181 Set the name of the current window to @var{windowtitle}. If no name is
2182 specified, screen prompts for one.
2185 @node Dynamic Titles, Title Prompts, Title Command, Naming Windows
2186 @subsection Dynamic Titles
2187 @code{screen} has a shell-specific heuristic that is enabled by
2188 setting the window's name to @var{search|name} and arranging to have a
2189 null title escape-sequence output as a part of your prompt. The
2190 @var{search} portion specifies an end-of-prompt search string, while the
2191 @var{name} portion specifies the default shell name for the window. If
2192 the @var{name} ends in a @samp{:} @code{screen} will add what it
2193 believes to be the current command running in the window to the end of
2194 the specified name (e.g. @var{name:cmd}). Otherwise the current
2195 command name supersedes the shell name while it is running.
2197 Here's how it works: you must modify your shell prompt to output a null
2198 title-escape-sequence (@key{ESC} k @key{ESC} \) as a part of your prompt.
2199 The last part of your prompt must be the same as the string you
2200 specified for the @var{search} portion of the title. Once this is set
2201 up, @code{screen} will use the title-escape-sequence to clear the previous
2202 command name and get ready for the next command. Then, when a newline
2203 is received from the shell, a search is made for the end of the prompt.
2204 If found, it will grab the first word after the matched string and use
2205 it as the command name. If the command name begins with @samp{!},
2206 @samp{%}, or @samp{^}, @code{screen} will use the first word on the
2207 following line (if found) in preference to the just-found name. This
2208 helps csh users get more accurate titles when using job control or
2209 history recall commands.
2211 @node Title Prompts, Title Screenrc, Dynamic Titles, Naming Windows
2212 @subsection Setting up your prompt for shell titles
2213 One thing to keep in mind when adding a null title-escape-sequence to your
2214 prompt is that some shells (like the csh) count all the non-control
2215 characters as part of the prompt's length. If these invisible
2216 characters aren't a multiple of 8 then backspacing over a tab will
2217 result in an incorrect display. One way to get around this is to use a
2221 set prompt='@value{esc}[0000m@value{esc}k@value{esc}\% '
2224 The escape-sequence @samp{@value{esc}[0000m} not only normalizes the
2225 character attributes, but all the zeros round the length of the
2226 invisible characters up to 8.
2228 Tcsh handles escape codes in the prompt more intelligently, so you can
2229 specify your prompt like this:
2232 set prompt="%@{\ek\e\\%@}\% "
2235 Bash users will probably want to echo the escape sequence in the
2239 PROMPT_COMMAND='printf "\033k\033\134"'
2242 (I used @samp{\134} to output a @samp{\} because of a bug in v1.04).
2244 @node Title Screenrc, , Title Prompts, Naming Windows
2245 @subsection Setting up shell titles in your @file{.screenrc}
2246 Here are some .screenrc examples:
2249 screen -t top 2 nice top
2252 Adding this line to your .screenrc would start a niced version of the
2253 @code{top} command in window 2 named @samp{top} rather than @samp{nice}.
2260 This file would start a shell using the given shelltitle. The title
2261 specified is an auto-title that would expect the prompt and the typed
2262 command to look something like the following:
2265 /usr/joe/src/dir> trn
2268 (it looks after the '> ' for the command name).
2269 The window status would show the name @samp{trn} while the command was
2270 running, and revert to @samp{csh} upon completion.
2273 bind R screen -t '% |root:' su
2276 Having this command in your .screenrc would bind the key sequence
2277 @kbd{C-a R} to the @code{su} command and give it an auto-title name of
2278 @samp{root:}. For this auto-title to work, the screen could look
2279 something like this:
2286 Here the user typed the csh history command @code{!em} which ran the
2287 previously entered @code{emacs} command. The window status would show
2288 @samp{root:emacs} during the execution of the command, and revert to
2289 simply @samp{root:} at its completion.
2294 bind u title (unknown)
2297 The first binding doesn't have any arguments, so it would prompt you for
2298 a title when you type @kbd{C-a o}. The second binding would clear an
2299 auto-titles current setting (C-a E). The third binding would set the
2300 current window's title to @samp{(unknown)} (C-a u).
2302 @node Console, Kill, Naming Windows, Window Settings
2304 @deffn Command console [@var{state}]
2306 Grabs or un-grabs the machines console output to a window. When the argument
2307 is omitted the current state is displayed.
2308 @emph{Note}: Only the owner of @file{/dev/console} can grab the console
2309 output. This command is only available if the host supports the ioctl
2313 @node Kill, Login, Console, Window Settings
2319 (@kbd{C-a k}, @kbd{C-a C-k})@*
2320 Kill the current window.@*
2321 If there is an @code{exec} command running (@pxref{Exec}) then it is killed.
2322 Otherwise the process (e.g. shell) running in the window receives a
2323 @code{HANGUP} condition,
2324 the window structure is removed and screen (your display) switches to another
2325 window. When the last window is destroyed, @code{screen} exits.
2326 After a kill screen switches to the previously displayed window.
2328 @emph{Caution}: @code{emacs} users may find themselves killing their
2329 @code{emacs} session when trying to delete the current line. For this
2330 reason, it is probably wise to use a different command character
2331 (@pxref{Command Character}) or rebind @code{kill} to another key
2332 sequence, such as @kbd{C-a K} (@pxref{Key Binding}).
2335 @node Login, Mode, Kill, Window Settings
2338 @deffn Command deflogin state
2340 Same as the @code{login} command except that the default setting for new
2341 windows is changed. This defaults to `on' unless otherwise specified at
2342 compile time (@pxref{Installation}). Both commands are only present when
2343 @code{screen} has been compiled with utmp support.
2347 @deffn Command login [state]
2349 Adds or removes the entry in @file{/etc/utmp} for the current window.
2350 This controls whether or not the window is @dfn{logged in}. In addition
2351 to this toggle, it is convenient to have ``log in'' and ``log out''
2352 keys. For instance, @code{bind I login on} and @code{bind O
2353 login off} will map these keys to be @kbd{C-a I} and @kbd{C-a O}
2354 (@pxref{Key Binding}).
2357 @node Mode, Monitor, Login, Window Settings
2359 @deffn Command defmode mode
2361 The mode of each newly allocated pseudo-tty is set to @var{mode}.
2362 @var{mode} is an octal number as used by chmod(1). Defaults to 0622 for
2363 windows which are logged in, 0600 for others (e.g. when @code{-ln} was
2364 specified for creation, @pxref{Screen Command}).
2367 @node Monitor, Windows, Mode, Window Settings
2370 @deffn Command activity message
2372 When any activity occurs in a background window that is being monitored,
2373 @code{screen} displays a notification in the message line. The
2374 notification message can be redefined by means of the @code{activity}
2375 command. Each occurrence of @samp{%} in @var{message} is replaced by
2376 the number of the window in which activity has occurred, and each
2377 occurrence of @samp{^G} is replaced by the definition for bell in your
2378 termcap (usually an audible bell). The default message is
2381 'Activity in window %n'
2384 Note that monitoring is off for all windows by default, but can be altered
2385 by use of the @code{monitor} command (@kbd{C-a M}).
2388 @deffn Command defmonitor state
2390 Same as the @code{monitor} command except that the default setting for
2391 new windows is changed. Initial setting is `off'.
2395 @deffn Command monitor [state]
2397 Toggles monitoring of the current window. When monitoring is turned on
2398 and the affected window is switched into the background, the activity
2399 notification message will be displayed in the status line at the first
2400 sign of output, and the window will also be marked with an @samp{@@} in
2401 the window-status display (@pxref{Windows}). Monitoring defaults to
2402 @samp{off} for all windows.
2405 @node Windows, Hardstatus, Monitor, Window Settings
2409 @deffn Command windows
2410 (@kbd{C-a w}, @kbd{C-a C-w})@*
2411 Uses the message line to display a list of all the windows. Each
2412 window is listed by number with the name of the program running in the
2413 window (or its title).
2415 The current window is marked with a @samp{*};
2416 the previous window is marked with a @samp{-};
2417 all the windows that are logged in are marked with a @samp{$} (@pxref{Login});
2418 a background window that has received a bell is marked with a @samp{!};
2419 a background window that is being monitored and has had activity occur is
2420 marked with an @samp{@@} (@pxref{Monitor});
2421 a window which has output logging turned on is marked with @samp{(L)};
2422 windows occupied by other users are marked with @samp{&}
2423 or @samp{&&} if the window is shared by other users;
2424 windows in the zombie state are marked with @samp{Z}.
2426 If this list is too long to fit on the terminal's status line only the
2427 portion around the current window is displayed.
2430 @node Hardstatus, Mousetrack, Windows, Window Settings
2433 @code{Screen} maintains a hardstatus line for every window. If a window
2434 gets selected, the display's hardstatus will be updated to match
2435 the window's hardstatus line.
2436 The hardstatus line can be changed with the ANSI Application
2437 Program Command (APC): @samp{ESC_<string>ESC\}. As a convenience
2438 for xterm users the sequence @samp{ESC]0..2;<string>^G} is
2441 @deffn Command defhstatus [status]
2443 The hardstatus line that all new windows will get is set to
2445 This command is useful to make the hardstatus of every window
2446 display the window number or title or the like. @var{status}
2447 may contain the same directives as in the window messages, but
2448 the directive escape character is @samp{^E} (octal 005) instead
2449 of @samp{%}. This was done to make a misinterpretation of program
2450 generated hardstatus lines impossible.
2451 If the parameter @var{status}
2452 is omitted, the current default string is displayed.
2453 Per default the hardstatus line of new windows is empty.
2456 @deffn Command hstatus status
2458 Changes the current window's hardstatus line to @var{status}.
2461 @node Mousetrack, , Hardstatus, Miscellaneous
2464 @deffn Command mousetrack [ @code{on|off} ]
2466 This command determines whether @code{screen} will watch for
2467 mouse clicks. When this command is enabled, regions that have
2468 been split in various ways can be selected by pointing to them
2469 with a mouse and left-clicking them. Without specifying @var{on}
2470 or @var{off}, the current state is displayed. The default state
2471 is determined by the @code{defmousetrack} command.
2474 @deffn Command defmousetrack @code{on|off}
2476 This command determines the default state of the @code{mousetrack}
2477 command, currently defaulting of @var{off}.
2480 @node Virtual Terminal, Copy and Paste, Window Settings, Top
2481 @chapter Virtual Terminal
2483 Each window in a @code{screen} session emulates a VT100 terminal, with
2484 some extra functions added. The VT100 emulator is hard-coded, no other
2485 terminal types can be emulated.
2486 The commands described here modify the terminal emulation.
2489 * Control Sequences:: Details of the internal VT100 emulation.
2490 * Input Translation:: How keystrokes are remapped.
2491 * Digraph:: Entering digraph sequences.
2492 * Bell:: Getting your attention.
2493 * Clear:: Clear the window display.
2494 * Info:: Terminal emulation statistics.
2495 * Redisplay:: When the display gets confusing.
2496 * Wrap:: Automatic margins.
2497 * Reset:: Recovering from ill-behaved applications.
2498 * Window Size:: Changing the size of your terminal.
2499 * Character Processing:: Change the effect of special characters.
2502 @node Control Sequences, Input Translation, , Virtual Terminal
2503 @section Control Sequences
2504 @cindex control sequences
2505 The following is a list of control sequences recognized by
2506 @code{screen}. @samp{(V)} and @samp{(A)} indicate VT100-specific and
2507 ANSI- or ISO-specific functions, respectively.
2513 ESC H Horizontal Tab Set
2514 ESC Z Send VT100 Identification String
2515 ESC 7 (V) Save Cursor and Attributes
2516 ESC 8 (V) Restore Cursor and Attributes
2517 ESC [s (A) Save Cursor and Attributes
2518 ESC [u (A) Restore Cursor and Attributes
2519 ESC c Reset to Initial State
2521 ESC Pn p Cursor Visibility (97801)
2524 ESC = (V) Application Keypad Mode
2525 ESC > (V) Numeric Keypad Mode
2526 ESC # 8 (V) Fill Screen with E's
2527 ESC \ (A) String Terminator
2528 ESC ^ (A) Privacy Message String (Message Line)
2529 ESC ! Global Message String (Message Line)
2530 ESC k Title Definition String
2531 ESC P (A) Device Control String
2532 Outputs a string directly to the host
2533 terminal without interpretation.
2534 ESC _ (A) Application Program Command (Hardstatus)
2535 ESC ] 0 ; string ^G (A) Operating System Command (Hardstatus, xterm
2537 ESC ] 83 ; cmd ^G (A) Execute screen command. This only works if
2538 multi-user support is compiled into screen.
2539 The pseudo-user ":window:" is used to check
2540 the access control list. Use "addacl :window:
2541 -rwx #?" to create a user with no rights and
2542 allow only the needed commands.
2543 Control-N (A) Lock Shift G1 (SO)
2544 Control-O (A) Lock Shift G0 (SI)
2545 ESC n (A) Lock Shift G2
2546 ESC o (A) Lock Shift G3
2547 ESC N (A) Single Shift G2
2548 ESC O (A) Single Shift G3
2549 ESC ( Pcs (A) Designate character set as G0
2550 ESC ) Pcs (A) Designate character set as G1
2551 ESC * Pcs (A) Designate character set as G2
2552 ESC + Pcs (A) Designate character set as G3
2553 ESC [ Pn ; Pn H Direct Cursor Addressing
2554 ESC [ Pn ; Pn f same as above
2555 ESC [ Pn J Erase in Display
2556 Pn = None or 0 From Cursor to End of Screen
2557 1 From Beginning of Screen to Cursor
2559 ESC [ Pn K Erase in Line
2560 Pn = None or 0 From Cursor to End of Line
2561 1 From Beginning of Line to Cursor
2563 ESC [ Pn X Erase character
2564 ESC [ Pn A Cursor Up
2565 ESC [ Pn B Cursor Down
2566 ESC [ Pn C Cursor Right
2567 ESC [ Pn D Cursor Left
2568 ESC [ Pn E Cursor next line
2569 ESC [ Pn F Cursor previous line
2570 ESC [ Pn G Cursor horizontal position
2571 ESC [ Pn ` same as above
2572 ESC [ Pn d Cursor vertical position
2573 ESC [ Ps ;...; Ps m Select Graphic Rendition
2574 Ps = None or 0 Default Rendition
2577 3 (A) @i{Standout} Mode (ANSI: Italicized)
2581 22 (A) Normal Intensity
2582 23 (A) @i{Standout} Mode off (ANSI: Italicized off)
2583 24 (A) Not Underlined
2585 27 (A) Positive Image
2586 30 (A) Foreground Black
2587 31 (A) Foreground Red
2588 32 (A) Foreground Green
2589 33 (A) Foreground Yellow
2590 34 (A) Foreground Blue
2591 35 (A) Foreground Magenta
2592 36 (A) Foreground Cyan
2593 37 (A) Foreground White
2594 39 (A) Foreground Default
2595 40 (A) Background Black
2597 49 (A) Background Default
2598 ESC [ Pn g Tab Clear
2599 Pn = None or 0 Clear Tab at Current Position
2601 ESC [ Pn ; Pn r (V) Set Scrolling Region
2602 ESC [ Pn I (A) Horizontal Tab
2603 ESC [ Pn Z (A) Backward Tab
2604 ESC [ Pn L (A) Insert Line
2605 ESC [ Pn M (A) Delete Line
2606 ESC [ Pn @@ (A) Insert Character
2607 ESC [ Pn P (A) Delete Character
2608 ESC [ Pn S Scroll Scrolling Region Up
2609 ESC [ Pn T Scroll Scrolling Region Down
2610 ESC [ Pn ^ same as above
2611 ESC [ Ps ;...; Ps h Set Mode
2612 ESC [ Ps ;...; Ps l Reset Mode
2613 Ps = 4 (A) Insert Mode
2614 20 (A) @samp{Automatic Linefeed} Mode.
2615 34 Normal Cursor Visibility
2616 ?1 (V) Application Cursor Keys
2617 ?3 (V) Change Terminal Width to 132 columns
2618 ?5 (V) Reverse Video
2619 ?6 (V) @samp{Origin} Mode
2620 ?7 (V) @samp{Wrap} Mode
2621 ?9 X10 mouse tracking
2622 ?25 (V) Visible Cursor
2623 ?47 Alternate Screen (old xterm code)
2624 ?1000 (V) VT200 mouse tracking
2625 ?1047 Alternate Screen (new xterm code)
2626 ?1049 Alternate Screen (new xterm code)
2627 ESC [ 5 i (A) Start relay to printer (ANSI Media Copy)
2628 ESC [ 4 i (A) Stop relay to printer (ANSI Media Copy)
2629 ESC [ 8 ; Ph ; Pw t Resize the window to @samp{Ph} lines and
2630 @samp{Pw} columns (SunView special)
2631 ESC [ c Send VT100 Identification String
2632 ESC [ x (V) Send Terminal Parameter Report
2633 ESC [ > c Send Secondary Device Attributes String
2634 ESC [ 6 n Send Cursor Position Report
2639 @node Input Translation, Digraph, Control Sequences, Virtual Terminal
2640 @section Input Translation
2641 @cindex input translation
2642 In order to do a full VT100 emulation @code{screen} has to detect
2643 that a sequence of characters in the input stream was generated
2644 by a keypress on the user's keyboard and insert the VT100
2645 style escape sequence. @code{Screen} has a very flexible way of doing
2646 this by making it possible to map arbitrary commands on arbitrary
2647 sequences of characters. For standard VT100 emulation the command
2648 will always insert a string in the input buffer of the window
2649 (see also command @code{stuff}, @pxref{Paste}).
2650 Because the sequences generated by a keypress can
2651 change after a reattach from a different terminal type, it is
2652 possible to bind commands to the termcap name of the keys.
2653 @code{Screen} will insert the correct binding after each
2654 reattach. See @ref{Bindkey} for further details on the syntax and examples.
2656 Here is the table of the default key bindings. (A) means that the
2657 command is executed if the keyboard is switched into application
2661 Key name Termcap name Command
2662 -----------------------------------------------------
2663 Cursor up ku stuff \033[A
2665 Cursor down kd stuff \033[B
2667 Cursor right kr stuff \033[C
2669 Cursor left kl stuff \033[D
2671 Function key 0 k0 stuff \033[10~
2672 Function key 1 k1 stuff \033OP
2673 Function key 2 k2 stuff \033OQ
2674 Function key 3 k3 stuff \033OR
2675 Function key 4 k4 stuff \033OS
2676 Function key 5 k5 stuff \033[15~
2677 Function key 6 k6 stuff \033[17~
2678 Function key 7 k7 stuff \033[18~
2679 Function key 8 k8 stuff \033[19~
2680 Function key 9 k9 stuff \033[20~
2681 Function key 10 k; stuff \033[21~
2682 Function key 11 F1 stuff \033[23~
2683 Function key 12 F2 stuff \033[24~
2684 Home kh stuff \033[1~
2685 End kH stuff \033[4~
2686 Insert kI stuff \033[2~
2687 Delete kD stuff \033[3~
2688 Page up kP stuff \033[5~
2689 Page down kN stuff \033[6~
2724 Keypad enter fe stuff \015
2728 @node Digraph, Bell, Input Translation, Virtual Terminal
2732 @deffn Command digraph [preset [unicode-value]]
2734 This command prompts the user for a digraph sequence. The next
2735 two characters typed are looked up in a builtin table and the
2736 resulting character is inserted in the input stream. For example,
2737 if the user enters @samp{a"}, an a-umlaut will be inserted. If the
2738 first character entered is a 0 (zero), @code{screen}
2739 will treat the following characters (up to three) as an octal
2740 number instead. The optional argument @var{preset}
2741 is treated as user input, thus one can create an "umlaut" key.
2742 For example the command @samp{bindkey ^K digraph '"'} enables the user
2743 to generate an a-umlaut by typing @samp{CTRL-K a}. When a non-zero
2744 @var{unicode-value} is specified, a new digraph is created with the
2745 specified preset. The digraph is unset if a zero value is provided
2746 for the @var{unicode-value}.
2748 The following table is the builtin sequences.
2750 @documentencoding ISO-8859-1
2752 Sequence Octal Digraph Unicode Equivalent
2753 -----------------------------------------------
2754 ' ', ' ' 160 (space) U+00A0
2755 'N', 'S' 160 (space) U+00A0
2756 '~', '!' 161 ¡ U+00A1
2757 '!', '!' 161 ¡ U+00A1
2758 '!', 'I' 161 ¡ U+00A1
2759 'c', '|' 162 ¢ U+00A2
2760 'c', 't' 162 ¢ U+00A2
2761 '$', '$' 163 £ U+00A3
2762 'P', 'd' 163 £ U+00A3
2763 'o', 'x' 164 ¤ U+00A4
2764 'C', 'u' 164 ¤ U+00A4
2765 'C', 'u' 164 ¤ U+00A4
2766 'E', 'u' 164 ¤ U+00A4
2767 'Y', '-' 165 ¥ U+00A5
2768 'Y', 'e' 165 ¥ U+00A5
2769 '|', '|' 166 ¦ U+00A6
2770 'B', 'B' 166 ¦ U+00A6
2771 'p', 'a' 167 § U+00A7
2772 'S', 'E' 167 § U+00A7
2773 '"', '"' 168 ¨ U+00A8
2774 ''', ':' 168 ¨ U+00A8
2775 'c', 'O' 169 © U+00A9
2776 'C', 'o' 169 © U+00A9
2777 'a', '-' 170 ª U+00AA
2778 '<', '<' 171 « U+00AB
2779 '-', ',' 172 ¬ U+00AC
2780 'N', 'O' 172 ¬ U+00AC
2781 '-', '-' 173 U+00AD
2782 'r', 'O' 174 ® U+00AE
2783 'R', 'g' 174 ® U+00AE
2784 '-', '=' 175 ¯ U+00AF
2785 ''', 'm' 175 ¯ U+00AF
2786 '~', 'o' 176 ° U+00B0
2787 'D', 'G' 176 ° U+00B0
2788 '+', '-' 177 ± U+00B1
2789 '2', '2' 178 ² U+00B2
2790 '2', 'S' 178 ² U+00B2
2791 '3', '3' 179 ³ U+00B3
2792 '3', 'S' 179 ³ U+00B3
2793 ''', ''' 180 ´ U+00B4
2794 'j', 'u' 181 µ U+00B5
2795 'M', 'y' 181 µ U+00B5
2796 'p', 'p' 182 ¶ U+00B6
2797 'P', 'I' 182 ¶ U+00B6
2798 '~', '.' 183 · U+00B7
2799 '.', 'M' 183 · U+00B7
2800 ',', ',' 184 ¸ U+00B8
2801 ''', ',' 184 ¸ U+00B8
2802 '1', '1' 185 ¹ U+00B9
2803 '1', 'S' 185 ¹ U+00B9
2804 'o', '-' 186 º U+00BA
2805 '>', '>' 187 » U+00BB
2806 '1', '4' 188 ¼ U+00BC
2807 '1', '2' 189 ½ U+00BD
2808 '3', '4' 190 ¾ U+00BE
2809 '~', '?' 191 ¿ U+00BF
2810 '?', '?' 191 ¿ U+00BF
2811 '?', 'I' 191 ¿ U+00BF
2812 'A', '`' 192 À U+00C0
2813 'A', '!' 192 À U+00C0
2814 'A', ''' 193 Á U+00C1
2815 'A', '^' 194 Â U+00C2
2816 'A', '>' 194 Â U+00C2
2817 'A', '~' 195 Ã U+00C3
2818 'A', '?' 195 Ã U+00C3
2819 'A', '"' 196 Ä U+00C4
2820 'A', ':' 196 Ä U+00C4
2821 'A', '@@' 197 Å U+00C5
2822 'A', 'A' 197 Å U+00C5
2823 'A', 'E' 198 Æ U+00C6
2824 'C', ',' 199 Ç U+00C7
2825 'E', '`' 200 È U+00C8
2826 'E', '!' 200 È U+00C8
2827 'E', ''' 201 É U+00C9
2828 'E', '^' 202 Ê U+00CA
2829 'E', '>' 202 Ê U+00CA
2830 'E', '"' 203 Ë U+00CB
2831 'E', ':' 203 Ë U+00CB
2832 'I', '`' 204 Ì U+00CC
2833 'I', '!' 204 Ì U+00CC
2834 'I', ''' 205 Í U+00CD
2835 'I', '^' 206 Î U+00CE
2836 'I', '>' 206 Î U+00CE
2837 'I', '"' 207 Ï U+00CF
2838 'I', ':' 207 Ï U+00CF
2839 'D', '-' 208 Ð U+00D0
2840 'N', '~' 209 Ñ U+00D1
2841 'N', '?' 209 Ñ U+00D1
2842 'O', '`' 210 Ò U+00D2
2843 'O', '!' 210 Ò U+00D2
2844 'O', ''' 211 Ó U+00D3
2845 'O', '^' 212 Ô U+00D4
2846 'O', '>' 212 Ô U+00D4
2847 'O', '~' 213 Õ U+00D5
2848 'O', '?' 213 Õ U+00D5
2849 'O', '"' 214 Ö U+00D6
2850 'O', ':' 214 Ö U+00D6
2851 '/', '\' 215 × U+00D7
2852 '*', 'x' 215 × U+00D7
2853 'O', '/' 216 Ø U+00D8
2854 'U', '`' 217 Ù U+00D9
2855 'U', '!' 217 Ù U+00D9
2856 'U', ''' 218 Ú U+00DA
2857 'U', '^' 219 Û U+00DB
2858 'U', '>' 219 Û U+00DB
2859 'U', '"' 220 Ü U+00DC
2860 'U', ':' 220 Ü U+00DC
2861 'Y', ''' 221 Ý U+00DD
2862 'I', 'p' 222 Þ U+00DE
2863 'T', 'H' 222 Þ U+00DE
2864 's', 's' 223 ß U+00DF
2865 's', '"' 223 ß U+00DF
2866 'a', '`' 224 à U+00E0
2867 'a', '!' 224 à U+00E0
2868 'a', ''' 225 á U+00E1
2869 'a', '^' 226 â U+00E2
2870 'a', '>' 226 â U+00E2
2871 'a', '~' 227 ã U+00E3
2872 'a', '?' 227 ã U+00E3
2873 'a', '"' 228 ä U+00E4
2874 'a', ':' 228 ä U+00E4
2875 'a', 'a' 229 å U+00E5
2876 'a', 'e' 230 æ U+00E6
2877 'c', ',' 231 ç U+00E7
2878 'e', '`' 232 è U+00E8
2879 'e', '!' 232 è U+00E8
2880 'e', ''' 233 é U+00E9
2881 'e', '^' 234 ê U+00EA
2882 'e', '>' 234 ê U+00EA
2883 'e', '"' 235 ë U+00EB
2884 'e', ':' 235 ë U+00EB
2885 'i', '`' 236 ì U+00EC
2886 'i', '!' 236 ì U+00EC
2887 'i', ''' 237 í U+00ED
2888 'i', '^' 238 î U+00EE
2889 'i', '>' 238 î U+00EE
2890 'i', '"' 239 ï U+00EF
2891 'i', ':' 239 ï U+00EF
2892 'd', '-' 240 ð U+00F0
2893 'n', '~' 241 ñ U+00F1
2894 'n', '?' 241 ñ U+00F1
2895 'o', '`' 242 ò U+00F2
2896 'o', '!' 242 ò U+00F2
2897 'o', ''' 243 ó U+00F3
2898 'o', '^' 244 ô U+00F4
2899 'o', '>' 244 ô U+00F4
2900 'o', '~' 245 õ U+00F5
2901 'o', '?' 245 õ U+00F5
2902 'o', '"' 246 ö U+00F6
2903 'o', ':' 246 ö U+00F6
2904 ':', '-' 247 ÷ U+00F7
2905 'o', '/' 248 ø U+00F8
2906 'u', '`' 249 ù U+00F9
2907 'u', '!' 249 ù U+00F9
2908 'u', ''' 250 ú U+00FA
2909 'u', '^' 251 û U+00FB
2910 'u', '>' 251 û U+00FB
2911 'u', '"' 252 ü U+00FC
2912 'u', ':' 252 ü U+00FC
2913 'y', ''' 253 ý U+00FD
2914 'i', 'p' 254 þ U+00FE
2915 't', 'h' 254 þ U+00FE
2916 'y', '"' 255 ÿ U+00FF
2917 'y', ':' 255 ÿ U+00FF
2918 '"', '[' 196 Ä U+00C4
2919 '"', '\' 214 Ö U+00D6
2920 '"', ']' 220 Ü U+00DC
2921 '"', '@{' 228 ä U+00E4
2922 '"', '|' 246 ö U+00F6
2923 '"', '@}' 252 ü U+00FC
2924 '"', '~' 223 ß U+00DF
2929 @node Bell, Clear, Digraph, Virtual Terminal
2932 @deffn Command bell_msg [message]
2934 When a bell character is sent to a background window, @code{screen}
2935 displays a notification in the message line. The notification message
2936 can be re-defined by this command. Each occurrence
2937 of @samp{%} in @var{message} is replaced by the number of the window to
2938 which a bell has been sent, and each occurrence of @samp{^G} is replaced
2939 by the definition for bell in your termcap (usually an audible bell).
2940 The default message is
2946 An empty message can be supplied to the @code{bell_msg} command to suppress
2947 output of a message line (@code{bell_msg ""}).
2948 Without a parameter, the current message is shown.
2952 @deffn Command vbell [state]
2954 Sets or toggles the visual bell setting for the current window. If
2955 @code{vbell} is switched to @samp{on}, but your
2956 terminal does not support a visual bell, the visual bell message is
2957 displayed in the status line when the bell character is received.
2958 Visual bell support of a terminal is
2959 defined by the termcap variable @code{vb}. @xref{Bell, , Visual Bell,
2960 termcap, The Termcap Manual}, for more information on visual bells.
2961 The equivalent terminfo capability is @code{flash}.
2963 Per default, @code{vbell} is @samp{off}, thus the audible bell is used.
2966 @deffn Command vbell_msg [message]
2968 Sets the visual bell message. @var{Message} is printed to the status
2969 line if the window receives a bell character (^G), @code{vbell} is
2970 set to @samp{on} and the terminal does not support a visual bell.
2971 The default message is @samp{Wuff, Wuff!!}.
2972 Without a parameter, the current message is shown.
2975 @deffn Command vbellwait sec
2977 Define a delay in seconds after each display of @code{screen} 's visual
2978 bell message. The default is 1 second.
2981 @node Clear, Info, Bell, Virtual Terminal
2984 @deffn Command clear
2986 Clears the screen and saves its contents to the scrollback buffer.
2989 @node Info, Redisplay, Clear, Virtual Terminal
2994 (@kbd{C-a i}, @kbd{C-a C-i})@*
2995 Uses the message line to display some information about the current
2996 window: the cursor position in the form @samp{(@var{column},@var{row})}
2997 starting with @samp{(1,1)}, the terminal width and height plus the size
2998 of the scrollback buffer in lines, like in @samp{(80,24)+50},
2999 the current state of window XON/XOFF flow control is shown like this
3000 (@pxref{Flow Control}):
3002 +flow automatic flow control, currently on.
3003 -flow automatic flow control, currently off.
3004 +(+)flow flow control enabled. Agrees with automatic control.
3005 -(+)flow flow control disabled. Disagrees with automatic control.
3006 +(-)flow flow control enabled. Disagrees with automatic control.
3007 -(-)flow flow control disabled. Agrees with automatic control.
3010 The current line wrap setting (@samp{+wrap} indicates enabled, @samp{-wrap}
3011 not) is also shown. The flags @samp{ins}, @samp{org}, @samp{app}, @samp{log},
3012 @samp{mon} and @samp{nored} are displayed when the window is in insert mode,
3013 origin mode, application-keypad mode, has output logging,
3014 activity monitoring or partial redraw enabled.
3016 The currently active
3017 character set (@samp{G0}, @samp{G1}, @samp{G2}, or @samp{G3}), and in
3018 square brackets the terminal character sets that are currently
3019 designated as @samp{G0} through @samp{G3}.
3020 If the window is in UTF-8 mode, the string @samp{UTF-8} is shown instead.
3021 Additional modes depending on the type of the window are displayed at
3022 the end of the status line (@pxref{Window Types}).
3024 If the state machine of the terminal emulator is in a non-default state,
3025 the info line is started with a string identifying the current state.
3027 For system information use @code{time}.
3030 @deffn Command dinfo
3032 Show what @code{screen} thinks about your terminal. Useful if you want to know
3033 why features like color or the alternate charset don't work.
3036 @node Redisplay, Wrap, Info, Virtual Terminal
3039 @deffn Command allpartial state
3041 If set to on, only the current cursor line is refreshed on window change.
3042 This affects all windows and is useful for slow terminal lines. The
3043 previous setting of full/partial refresh for each window is restored
3044 with @code{allpartial off}. This is a global flag that immediately takes effect
3045 on all windows overriding the @code{partial} settings. It does not change the
3046 default redraw behavior of newly created windows.
3049 @deffn Command altscreen state
3051 If set to on, "alternate screen" support is enabled in virtual terminals,
3052 just like in xterm. Initial setting is @samp{off}.
3055 @deffn Command partial state
3057 Defines whether the display should be refreshed (as with
3058 @code{redisplay}) after switching to the current window. This command
3059 only affects the current window. To immediately affect all windows use the
3060 @code{allpartial} command. Default is @samp{off}, of course. This default is
3061 fixed, as there is currently no @code{defpartial} command.
3066 @deffn Command redisplay
3067 (@kbd{C-a l}, @kbd{C-a C-l})@*
3068 Redisplay the current window. Needed to get a full redisplay in
3069 partial redraw mode.
3072 @node Wrap, Reset, Redisplay, Virtual Terminal
3077 @deffn Command wrap state
3078 (@kbd{C-a r}, @kbd{C-a C-r}) @*
3079 Sets the line-wrap setting for the current window. When line-wrap is
3080 on, the second consecutive printable character output at the last column
3081 of a line will wrap to the start of the following line. As an added
3082 feature, backspace (^H) will also wrap through the left margin to the
3083 previous line. Default is @samp{on}.
3086 @deffn Command defwrap state
3088 Same as the @code{wrap} command except that the default setting for new
3089 windows is changed. Initially line-wrap is on and can be toggled with the
3090 @code{wrap} command (@kbd{C-a r}) or by means of "C-a : wrap on|off".
3093 @node Reset, Window Size, Wrap, Virtual Terminal
3096 @deffn Command reset
3098 Reset the virtual terminal to its ``power-on'' values. Useful when strange
3099 settings (like scroll regions or graphics character set) are left over from
3103 @node Window Size, Character Processing, Reset, Virtual Terminal
3104 @section Window Size
3106 @deffn Command width [@code{-w}|@code{-d}] [cols [lines]]
3108 Toggle the window width between 80 and 132 columns, or set it to
3109 @var{cols} columns if an argument is specified. This requires a
3110 capable terminal and the termcap entries @samp{Z0} and @samp{Z1}. See
3111 the @code{termcap} command (@pxref{Termcap}), for more information.
3112 You can also specify a height if you want to
3113 change both values. The @code{-w} option tells screen to leave
3114 the display size unchanged and just set the window size,
3115 @code{-d} vice versa.
3118 @deffn Command height [@code{-w}|@code{-d}] [lines [cols]]
3120 Set the display height to a specified number of lines. When no
3121 argument is given it toggles between 24 and 42 lines display.
3124 @node Character Processing, ,Window Size, Virtual Terminal
3125 @section Character Processing
3127 @deffn Command c1 [state]
3129 Change c1 code processing. @samp{c1 on} tells screen to treat
3130 the input characters between 128 and 159 as control functions.
3131 Such an 8-bit code is normally the same as ESC followed by the
3132 corresponding 7-bit code. The default setting is to process c1
3133 codes and can be changed with the @samp{defc1} command.
3134 Users with fonts that have usable characters in the
3135 c1 positions may want to turn this off.
3138 @deffn Command gr [state]
3140 Turn GR charset switching on/off. Whenever screen sees an input
3141 char with an 8th bit set, it will use the charset stored in the
3142 GR slot and print the character with the 8th bit stripped. The
3143 default (see also @samp{defgr}) is not to process GR switching because
3144 otherwise the ISO88591 charset would not work.
3147 @deffn Command bce [state]
3149 Change background-color-erase setting. If @samp{bce} is set to
3150 on, all characters cleared by an erase/insert/scroll/clear
3151 operation will be displayed in the current background color.
3152 Otherwise the default background color is used.
3155 @deffn Command encoding enc [denc]
3157 Tell screen how to interpret the input/output. The first argument
3158 sets the encoding of the current window.
3159 Each window can emulate a different encoding. The optional second
3160 parameter overwrites the encoding of the connected terminal.
3161 It should never be needed as screen uses the locale setting to detect
3163 There is also a way to select a terminal encoding depending on
3164 the terminal type by using the @samp{KJ} termcap entry. @xref{Special Capabilities}.
3166 Supported encodings are
3167 @code{eucJP}, @code{SJIS}, @code{eucKR},
3168 @code{eucCN}, @code{Big5}, @code{GBK}, @code{KOI8-R}, @code{CP1251},
3169 @code{UTF-8}, @code{ISO8859-2}, @code{ISO8859-3},
3170 @code{ISO8859-4}, @code{ISO8859-5}, @code{ISO8859-6},
3171 @code{ISO8859-7}, @code{ISO8859-8}, @code{ISO8859-9},
3172 @code{ISO8859-10}, @code{ISO8859-15}, @code{jis}.
3174 See also @samp{defencoding}, which changes the default setting of a new
3178 @deffn Command charset set
3180 Change the current character set slot designation and charset
3181 mapping. The first four character of @var{set}
3182 are treated as charset designators while the fifth and sixth
3183 character must be in range @samp{0} to @samp{3} and set the GL/GR
3184 charset mapping. On every position a @samp{.} may be used to indicate
3185 that the corresponding charset/mapping should not be changed
3186 (@var{set} is padded to six characters internally by appending
3187 @samp{.} chars). New windows have @samp{BBBB02} as default
3188 charset, unless a @samp{encoding} command is active.
3190 The current setting can be viewed with the @ref{Info} command.
3193 @deffn Command utf8 [state [dstate]]
3195 Change the encoding used in the current window. If utf8 is enabled, the
3196 strings sent to the window will be UTF-8 encoded and vice versa.
3198 parameter toggles the setting. If a second parameter is given, the
3200 encoding is also changed (this should rather be done with screen's
3202 See also @samp{defutf8}, which changes the default setting of a new
3206 @deffn Command defc1 state
3208 Same as the @samp{c1} command except that the default setting for
3209 new windows is changed. Initial setting is @samp{on}.
3212 @deffn Command defgr state
3214 Same as the @samp{gr} command except that the default setting for
3215 new windows is changed. Initial setting is @samp{off}.
3218 @deffn Command defbce state
3220 Same as the @samp{bce} command except that the default setting for
3221 new windows is changed. Initial setting is @samp{off}.
3224 @deffn Command defencoding enc
3226 Same as the @samp{encoding} command except that the default setting for
3227 new windows is changed. Initial setting is the encoding taken from the
3231 @deffn Command defcharset [set]
3232 Like the @samp{charset} command except that the default setting for
3233 new windows is changed. Shows current default if called without
3237 @deffn Command defutf8 state
3239 Same as the @samp{utf8} command except that the default setting for new
3240 windows is changed. Initial setting is @code{on} if screen was started
3241 with @samp{-U}, otherwise @code{off}.
3244 @node Copy and Paste, Subprocess Execution, Virtual Terminal, Top
3245 @chapter Copy and Paste
3246 @cindex copy and paste
3248 For those confined to a hardware terminal, these commands provide a cut
3249 and paste facility more powerful than those provided by most windowing
3253 * Copy:: Copy from scrollback to buffer
3254 * Paste:: Paste from buffer into window
3255 * Registers:: Longer-term storage
3256 * Screen Exchange:: Sharing data between screen users
3257 * History:: Recalling previous input
3260 @node Copy, Paste, , Copy and Paste
3268 (@kbd{C-a [}, @kbd{C-a C-[}, @kbd{C-a @key{ESC}})@*
3269 Enter copy/scrollback mode. This allows you to copy text from the
3270 current window and its history into the paste buffer. In this mode a
3271 @code{vi}-like full screen editor is active, with controls as
3276 * Line Termination:: End copied lines with CR/LF
3277 * Scrollback:: Set the size of the scrollback buffer
3278 * Copy Mode Keys:: Remap keys in copy mode
3279 * Movement:: Move around in the scrollback buffer
3280 * Marking:: Select the text you want
3281 * Repeat count:: Repeat a command
3282 * Searching:: Find the text you want
3283 * Specials:: Other random keys
3286 @node Line Termination, Scrollback, , Copy
3288 @deffn Command crlf [state]
3290 This affects the copying of text regions with the @code{copy} command.
3291 If it is set to @samp{on}, lines will be separated by the two character
3292 sequence @samp{CR}/@samp{LF}. Otherwise only @samp{LF} is used.
3293 @code{crlf} is off by default.
3294 When no parameter is given, the state is toggled.
3297 @node Scrollback, Copy Mode Keys, Line Termination, Copy
3298 @subsection Scrollback
3299 @deffn Command defscrollback num
3301 Same as the @code{scrollback} command except that the default setting
3302 for new windows is changed. Defaults to 100.
3305 @deffn Command scrollback num
3307 Set the size of the scrollback buffer for the current window to
3308 @var{num} lines. The default scrollback is 100 lines. Use @copy{info}
3309 to view the current setting.
3312 @deffn Command compacthist [state]
3314 This tells screen whether to suppress trailing blank lines when
3315 scrolling up text into the history buffer. Turn compacting @samp{on}
3316 to hold more useful lines in your scrollback buffer.
3319 @node Copy Mode Keys, Movement, Scrollback, Copy
3320 @subsection markkeys
3321 @deffn Command markkeys string
3323 This is a method of changing the keymap used for copy/history mode. The
3324 string is made up of @var{oldchar}=@var{newchar} pairs which are
3325 separated by @samp{:}. Example: The command @code{markkeys
3326 h=^B:l=^F:$=^E} would set some keys to be more familiar to @code{emacs}
3328 If your terminal sends characters, that cause you to abort copy mode,
3329 then this command may help by binding these characters to do nothing.
3330 The no-op character is `@@' and is used like this: @code{markkeys @@=L=H}
3331 if you do not want to use the `H' or `L' commands any longer.
3332 As shown in this example, multiple keys can be assigned to one function
3333 in a single statement.
3336 @node Movement, Marking, Copy Mode Keys, Copy
3337 @subsection Movement Keys
3340 @kbd{h}, @kbd{j}, @kbd{k}, @kbd{l} move the cursor line by line or
3344 @kbd{0}, @kbd{^} and @kbd{$} move to the leftmost column or to the first
3345 or last non-whitespace character on the line.
3348 @kbd{H}, @kbd{M} and @kbd{L} move the cursor to the leftmost column
3349 of the top, center or bottom line of the window.
3352 @kbd{+} and @kbd{-} move the cursor to the leftmost column of the next
3356 @kbd{G} moves to the specified absolute line (default: end of buffer).
3359 @kbd{|} moves to the specified absolute column.
3362 @kbd{w}, @kbd{b}, @kbd{e} move the cursor word by word.
3365 @kbd{B}, @kbd{E} move the cursor WORD by WORD (as in vi).
3368 @kbd{C-u} and @kbd{C-d} scroll the display up/down by the specified
3369 amount of lines while preserving the cursor position. (Default: half
3373 @kbd{C-b} and @kbd{C-f} move the cursor up/down a full screen.
3376 @kbd{g} moves to the beginning of the buffer.
3379 @kbd{%} jumps to the specified percentage of the buffer.
3381 Note that Emacs-style movement keys can be specified by a .screenrc
3382 command. (@code{markkeys "h=^B:l=^F:$=^E"}) There is no simple method for
3383 a full emacs-style keymap, however, as this involves multi-character codes.
3385 @node Marking, Repeat count, Movement, Copy
3388 The copy range is specified by setting two marks. The text between these
3389 marks will be highlighted. Press @kbd{space} to set the first or second
3393 @kbd{Y} and @kbd{y} can be used to mark one whole line or to mark from
3397 @kbd{W} marks exactly one word.
3399 @node Repeat count, Searching, Marking, Copy
3400 @subsection Repeat Count
3402 Any command in copy mode can be prefixed with a number (by pressing
3403 digits @kbd{0@dots{}9}) which is taken as a repeat count. Example:
3404 @kbd{C-a C-[ H 10 j 5 Y} will copy lines 11 to 15 into the paste buffer.
3406 @node Searching, Specials, Repeat count, Copy
3407 @subsection Searching
3410 @kbd{/} @code{vi}-like search forward.
3413 @kbd{?} @code{vi}-like search backward.
3416 @kbd{C-a s} @code{emacs} style incremental search forward.
3419 @kbd{C-r} @code{emacs} style reverse i-search.
3421 @deffn Command ignorecase [state]
3423 Tell screen to ignore the case of characters in searches. Default is
3427 @node Specials, , Searching, Copy
3428 @subsection Specials
3430 There are, however, some keys that act differently here from in
3431 @code{vi}. @code{Vi} does not allow to yank rectangular blocks of text,
3432 but @code{screen} does. Press
3435 @kbd{c} or @kbd{C} to set the left or right margin respectively. If no
3436 repeat count is given, both default to the current cursor position.@*
3437 Example: Try this on a rather full text screen:
3438 @kbd{C-a [ M 20 l SPACE c 10 l 5 j C SPACE}.
3441 This moves one to the middle line of the screen, moves in 20 columns left,
3442 marks the beginning of the paste buffer, sets the left column, moves 5 columns
3443 down, sets the right column, and then marks the end of
3444 the paste buffer. Now try:@*
3445 @kbd{C-a [ M 20 l SPACE 10 l 5 j SPACE}
3448 and notice the difference in the amount of text copied.
3451 @kbd{J} joins lines. It toggles between 4 modes: lines separated by a
3452 newline character (012), lines glued seamless, lines separated by a single
3453 space or comma separated lines. Note that you can prepend the newline
3454 character with a carriage return character, by issuing a @code{set crlf
3458 @kbd{v} is for all the @code{vi} users who use @code{:set numbers} - it
3459 toggles the left margin between column 9 and 1.
3462 @kbd{a} before the final space key turns on append mode. Thus
3463 the contents of the paste buffer will not be overwritten, but appended to.
3466 @kbd{A} turns on append mode and sets a (second) mark.
3469 @kbd{>} sets the (second) mark and writes the contents of the paste buffer
3470 to the screen-exchange file (@file{/tmp/screen-exchange} per default)
3471 once copy-mode is finished. @xref{Screen Exchange}.@*
3472 This example demonstrates how to dump the
3473 whole scrollback buffer to that file: @*@kbd{C-a [ g SPACE G $ >}.
3476 @kbd{C-g} gives information about the current line and column.
3479 @kbd{x} exchanges the first mark and the current cursor position. You
3480 can use this to adjust an already placed mark.
3483 @kbd{@@} does nothing. Absolutely nothing. Does not even exit copy
3487 All keys not described here exit copy mode.
3489 @node Paste, Registers, Copy, Copy and Paste
3494 @deffn Command paste [registers [destination]]
3495 (@kbd{C-a ]}, @kbd{C-a C-]})@*
3496 Write the (concatenated) contents of the specified registers to the stdin
3497 stream of the current window. The register @samp{.} is treated as the
3498 paste buffer. If no parameter is specified the user is prompted to enter a
3499 single register. The paste buffer can be filled with the
3500 @code{copy}, @code{history} and @code{readbuf} commands.
3501 Other registers can be filled with the @code{register}, @code{readreg} and
3502 @code{paste} commands.
3503 If @code{paste} is called with a second argument, the contents of the specified
3504 registers is pasted into the named destination register rather than
3505 the window. If @samp{.} is used as the second argument, the display's paste
3506 buffer is the destination.
3507 Note, that @code{paste} uses a wide variety of resources: Usually both, a
3508 current window and a current display are required. But whenever a second
3509 argument is specified no current window is needed. When the source specification
3510 only contains registers (not the paste buffer) then there need not be a current
3511 display (terminal attached), as the registers are a global resource. The
3512 paste buffer exists once for every user.
3515 @deffn Command stuff string
3517 Stuff the string @var{string} in the input buffer of the current window.
3518 This is like the @code{paste} command, but with much less overhead.
3519 You cannot paste large buffers with the @code{stuff} command. It is most
3520 useful for key bindings. @xref{Bindkey}.
3523 @deffn Command pastefont [state]
3524 Tell screen to include font information in the paste buffer. The
3525 default is not to do so. This command is especially useful for
3526 multi character fonts like kanji.
3529 @deffn Command slowpaste msec
3530 @deffnx Command defslowpaste msec
3532 Define the speed text is inserted in the current window by the @code{paste}
3533 command. If the slowpaste value is nonzero text is written character by
3535 @code{screen} will pause for @var{msec} milliseconds after each write
3536 to allow the application to process the input. only use @code{slowpaste} if
3537 your underlying system exposes flow control problems while pasting large
3539 @code{defslowpaste} specifies the default for new windows.
3542 @deffn Command readreg [-e encoding] [register [filename]]
3544 Does one of two things, dependent on number of arguments: with zero or one
3545 arguments it it duplicates the paste buffer contents into the register specified
3546 or entered at the prompt. With two arguments it reads the contents of the named
3547 file into the register, just as @code{readbuf} reads the screen-exchange file
3548 into the paste buffer.
3549 You can tell screen the encoding of the file via the @code{-e} option.
3550 The following example will paste the system's password file into
3551 the screen window (using register p, where a copy remains):
3554 C-a : readreg p /etc/passwd
3559 @node Registers, Screen Exchange, Paste, Copy and Paste
3562 @deffn Command copy_reg [key]
3564 Removed. Use @code{readreg} instead.
3567 @deffn Command ins_reg [key]
3569 Removed. Use @code{paste} instead.
3572 @deffn Command process [key]
3574 Stuff the contents of the specified register into the @code{screen}
3575 input queue. If no argument is given you are prompted for a
3576 register name. The text is parsed as if it had been typed in from the user's
3577 keyboard. This command can be used to bind multiple actions to a single key.
3580 @deffn Command register [-e encoding] key string
3582 Save the specified @var{string} to the register @var{key}.
3583 The encoding of the string can be specified via the @code{-e} option.
3586 @node Screen Exchange, History, Registers, Copy and Paste
3587 @section Screen Exchange
3589 @deffn Command bufferfile [@var{exchange-file}]
3591 Change the filename used for reading and writing with the paste buffer.
3592 If the @var{exchange-file} parameter is omitted, @code{screen} reverts
3593 to the default of @file{/tmp/screen-exchange}. The following example
3594 will paste the system's password file into the screen window (using the
3595 paste buffer, where a copy remains):
3598 C-a : bufferfile /etc/passwd
3605 @deffn Command readbuf [-e @var{encoding}] [@var{filename}]
3607 Reads the contents of the specified file into the paste buffer.
3608 You can tell screen the encoding of the file via the @code{-e} option.
3609 If no file is specified, the screen-exchange filename is used.
3613 @deffn Command removebuf
3615 Unlinks the screen-exchange file.
3619 @deffn Command writebuf [-e @var{encoding}] [@var{filename}]
3621 Writes the contents of the paste buffer to the specified file, or the
3622 public accessible screen-exchange file if no filename is given.
3623 This is thought of as a primitive means of
3624 communication between @code{screen} users on the same host.
3625 If an encoding is specified the paste buffer is recoded on the fly to
3628 @kbd{C-a @key{ESC}} (@pxref{Copy}).
3631 @node History, , Screen Exchange, Copy and Paste
3636 @deffn Command history
3637 (@kbd{C-a @{}, @kbd{C-a @}})@*
3638 Usually users work with a shell that allows easy access to previous
3639 commands. For example, @code{csh} has the command @code{!!} to repeat
3640 the last command executed. @code{screen} provides a primitive way of
3641 recalling ``the command that started @dots{}'': You just type the first
3642 letter of that command, then hit @kbd{C-a @{} and @code{screen} tries to
3643 find a previous line that matches with the prompt character to the left
3644 of the cursor. This line is pasted into this window's input queue. Thus
3645 you have a crude command history (made up by the visible window and its
3649 @node Subprocess Execution, Key Binding, Copy and Paste, Top
3650 @chapter Subprocess Execution
3651 Control Input or Output of a window by another filter process.
3655 * Exec:: The @code{exec} command syntax.
3656 * Using Exec:: Weird things that filters can do.
3659 @node Exec, Using Exec, , Subprocess Execution
3661 @deffn Command exec [[@var{fdpat}] @var{newcommand} [@var{args} ... ]]
3663 Run a unix subprocess (specified by an executable path @var{newcommand} and
3664 its optional arguments) in the current window. The flow of data between
3665 newcommands stdin/stdout/stderr, the process originally started (let us call it
3666 "application-process") and
3667 screen itself (window) is controlled by the file descriptor pattern @var{fdpat}.
3668 This pattern is basically a three character sequence representing stdin, stdout
3669 and stderr of newcommand. A dot (@code{.}) connects the file descriptor
3670 to screen. An exclamation mark (@code{!}) causes the file descriptor to be
3671 connected to the application-process. A colon (@code{:}) combines both.
3673 User input will go to newcommand unless newcommand receives the
3674 application-process'
3675 output (@var{fdpat}s first character is @samp{!} or @samp{:}) or a pipe symbol
3676 (@samp{|}) is added to the end of @var{fdpat}.
3678 Invoking @code{exec} without arguments shows name and arguments of the currently
3679 running subprocess in this window. Only one subprocess can be running per
3682 When a subprocess is running the @code{kill} command will affect it instead of
3683 the windows process. Only one subprocess a time can be running in each window.
3685 Refer to the postscript file @file{doc/fdpat.ps} for a confusing
3686 illustration of all 21 possible combinations. Each drawing shows the digits
3687 2, 1, 0 representing the three file descriptors of newcommand. The box
3688 marked `W' is usual pty that has the application-process on its slave side.
3689 The box marked `P' is the secondary pty that now has screen at its master
3693 @node Using Exec, , Exec, Subprocess Execution
3700 Whitespace between the word @samp{exec} and @var{fdpat} and the command name
3704 Trailing dots and a @var{fdpat} consisting only of dots can be omitted.
3707 A simple @samp{|} is synonymous for the @samp{!..|} pattern.
3710 The word @samp{exec} can be omitted when the @samp{|} abbreviation is used.
3713 The word @samp{exec} can always be replaced by leading @samp{!}.
3722 @itemx exec ... /bin/sh
3723 All of the above are equivalent.
3724 Creates another shell in the same window, while the original shell is still
3725 running. Output of both shells is displayed and user input is sent to the new
3729 @itemx exec!stty 19200
3730 @itemx exec !.. stty 19200
3731 All of the above are equivalent.
3732 Set the speed of the window's tty. If your stty command operates on stdout,
3733 then add another @samp{!}. This is a useful command, when a screen window
3734 is directly connected to a serial line that needs to be configured.
3737 @itemx exec !..| less
3738 Both are equivalent.
3739 This adds a pager to the window output. The special character @samp{|} is
3740 needed to give the user control over the pager although it gets its input from
3741 the window's process. This works, because @samp{less} listens on stderr
3742 (a behavior that @code{screen} would not expect without the @samp{|})
3743 when its stdin is not a tty. @code{Less} versions newer than 177 fail miserably
3744 here; good old @code{pg} still works.
3746 @item !:sed -n s/.*Error.*/\007/p
3747 Sends window output to both, the user and the sed command. The sed inserts an
3748 additional bell character (oct. 007) to the window output seen by screen.
3749 This will cause 'Bell in window x' messages, whenever the string @samp{Error}
3750 appears in the window.
3753 @node Key Binding, Flow Control, Subprocess Execution, Top
3754 @chapter Key Binding
3758 You may disagree with some of the default bindings (I know I do). The
3759 @code{bind} command allows you to redefine them to suit your
3763 * Bind:: @code{bind} syntax.
3764 * Bind Examples:: Using @code{bind}.
3765 * Command Character:: The character used to start keyboard commands.
3766 * Help:: Show current key bindings.
3767 * Bindkey:: @code{bindkey} syntax.
3768 * Bindkey Examples:: Some easy examples.
3769 * Bindkey Control:: How to control the bindkey mechanism.
3772 @node Bind, Bind Examples, , Key Binding
3773 @section The @code{bind} command
3774 @deffn Command bind [-c class] key [command [args]]
3776 Bind a command to a key. The @var{key} argument is either a single
3777 character, a two-character sequence of the form @samp{^x} (meaning
3778 @kbd{C-x}), a backslash followed by an octal number (specifying the
3779 ASCII code of the character), or a backslash followed by a second
3780 character, such as @samp{\^} or @samp{\\}. The argument can also be
3781 quoted, if you like. If no further argument is given, any previously
3782 established binding for this key is removed. The @var{command}
3783 argument can be any command (@pxref{Command Index}).
3785 If a command class is specified via the @code{-c} option, the
3786 key is bound for the specified class. Use the @code{command}
3787 command to activate a class. Command classes can be used
3788 to create multiple command keys or multi-character bindings.
3790 By default, most suitable commands are bound to one or more keys
3791 (@pxref{Default Key Bindings}); for instance, the command to create a
3792 new window is bound to @kbd{C-c} and @kbd{c}. The @code{bind} command
3793 can be used to redefine the key bindings and to define new bindings.
3796 @deffn Command unbindall
3798 Unbind all the bindings. This can be useful when
3799 screen is used solely for its detaching abilities, such as when
3800 letting a console application run as a daemon. If, for some reason,
3801 it is necessary to bind commands after this, use 'screen -X'.
3804 @node Bind Examples, Command Character, Bind, Key Binding
3805 @section Examples of the @code{bind} command
3811 bind ^f screen telnet foobar
3812 bind \033 screen -ln -t root -h 1000 9 su
3816 would bind the space key to the command that displays a list of windows
3817 (so that the command usually invoked by @kbd{C-a C-w} would also be
3818 available as @kbd{C-a space}), bind @kbd{C-f} to the command
3819 ``create a window with a TELNET connection to foobar'', and bind
3820 @key{ESC} to the command that creates an non-login window with title
3821 @samp{root} in slot #9, with a superuser shell and a scrollback buffer
3825 bind -c demo1 0 select 10
3826 bind -c demo1 1 select 11
3827 bind -c demo1 2 select 12
3828 bindkey "^B" command -c demo1
3830 makes @kbd{C-b 0} select window 10, @kbd{C-b 1} window 11, etc.
3833 bind -c demo2 0 select 10
3834 bind -c demo2 1 select 11
3835 bind -c demo2 2 select 12
3836 bind - command -c demo2
3838 makes @kbd{C-a - 0} select window 10, @kbd{C-a - 1} window 11, etc.
3840 @node Command Character, Help, Bind Examples, Key Binding
3841 @cindex escape character
3842 @cindex command character
3843 @section Command Character
3845 @deffn Command escape xy
3847 Set the command character to @var{x} and the character generating a
3848 literal command character (by triggering the @code{meta} command)
3849 to @var{y} (similar to the @samp{-e} option).
3850 Each argument is either a single character, a two-character
3851 sequence of the form @samp{^x} (meaning @kbd{C-x}), a backslash followed
3852 by an octal number (specifying the ASCII code of the character), or a
3853 backslash followed by a second character, such as @samp{\^} or
3854 @samp{\\}. The default is @samp{^Aa}, but @samp{``} is recommended by
3858 @deffn Command defescape xy
3860 Set the default command characters. This is equivalent to the command
3861 @code{escape} except that it is useful for multiuser sessions only.
3862 In a multiuser session
3863 @code{escape} changes the command character of the calling user, where
3864 @code{defescape} changes the default command characters for users that
3865 will be added later.
3871 Send the command character (@kbd{C-a}) to the process in the current
3872 window. The keystroke for this command is the second parameter to the
3873 @samp{-e} command line switch (@pxref{Invoking Screen}), or the
3874 @code{escape} .screenrc directive.
3877 @deffn Command command [-c @var{class}]
3879 This command has the same effect as typing the screen escape character
3880 (@kbd{C-a}). It is probably only useful for key bindings.
3881 If the @samp{-c} option is given, select the specified command class.
3882 @xref{Bind}, @xref{Bindkey}.
3885 @node Help, Bindkey, Command Character, Key Binding
3890 Displays a help screen showing you all the key bindings. The first
3891 pages list all the internal commands followed by their bindings.
3892 Subsequent pages will display the custom commands, one command per key.
3893 Press space when you're done reading each page, or return to exit early.
3894 All other characters are ignored.
3895 If the @samp{-c} option is given, display all bound commands for the
3896 specified command class.
3897 @xref{Default Key Bindings}.
3900 @node Bindkey, Bindkey Examples, Help, Key Binding
3902 @deffn Command bindkey [@var{opts}] [@var{string} [@var{cmd} @var{args}]]
3904 This command manages screen's input translation tables. Every
3905 entry in one of the tables tells screen how to react if a certain
3906 sequence of characters is encountered. There are three tables:
3907 one that should contain actions programmed by the user, one for
3908 the default actions used for terminal emulation and one for
3909 screen's copy mode to do cursor movement. See @ref{Input Translation}
3910 for a list of default key bindings.
3913 option is given, bindkey modifies the default table, @samp{-m}
3914 changes the copy mode table and with neither option the user
3915 table is selected. The argument @samp{string} is the sequence of
3916 characters to which an action is bound. This can either be a fixed
3917 string or a termcap keyboard capability name (selectable with the
3920 Some keys on a VT100 terminal can send a different
3921 string if application mode is turned on (e.g. the cursor keys).
3922 Such keys have two entries in the translation table. You can
3923 select the application mode entry by specifying the @samp{-a}
3926 The @samp{-t} option tells screen not to do inter-character
3927 timing. One cannot turn off the timing if a termcap capability is
3930 @samp{cmd} can be any of screen's commands with an arbitrary
3931 number of @samp{args}. If @samp{cmd} is omitted the key-binding is
3932 removed from the table.
3935 @node Bindkey Examples, Bindkey Control,Bindkey, Key Binding
3936 @section Bindkey Examples
3938 Here are some examples of keyboard bindings:
3944 Show all of the default key bindings. The application mode entries
3945 are marked with [A].
3948 bindkey -k k1 select 1
3951 Make the "F1" key switch to window one.
3954 bindkey -t foo stuff barfoo
3957 Make @samp{foo} an abbreviation of the word @samp{barfoo}. Timeout is
3958 disabled so that users can type slowly.
3961 bindkey "\024" mapdefault
3964 This key-binding makes @samp{C-t} an escape character for key-bindings. If
3965 you did the above @samp{stuff barfoo} binding, you can enter the word
3966 @samp{foo} by typing @samp{C-t foo}. If you want to insert a
3967 @samp{C-t} you have to press the key twice (i.e., escape the escape
3971 bindkey -k F1 command
3974 Make the F11 (not F1!) key an alternative screen
3975 escape (besides @samp{C-a}).
3977 @node Bindkey Control, , Bindkey Examples, Key Binding
3978 @section Bindkey Control
3979 @deffn Command mapdefault
3981 Tell screen that the next input character should only be looked up
3982 in the default bindkey table.
3984 @deffn Command mapnotnext
3986 Like mapdefault, but don't even look in the default bindkey table.
3988 @deffn Command maptimeout n
3990 Set the inter-character timer for input sequence detection to a timeout
3991 of @var{n} ms. The default timeout is 300ms. Maptimeout with no
3992 arguments shows the current setting.
3995 @node Flow Control, Termcap, Key Binding, Top
3996 @chapter Flow Control
3997 @cindex flow control
3999 @code{screen} can trap flow control characters or pass them to the
4000 program, as you see fit. This is useful when your terminal wants to use
4001 XON/XOFF flow control and you are running a program which wants to use
4002 ^S/^Q for other purposes (i.e. @code{emacs}).
4005 * Flow Control Summary:: The effect of @code{screen} flow control
4006 * Flow:: Setting the flow control behavior
4007 * XON/XOFF:: Sending XON or XOFF to the window
4010 @node Flow Control Summary, Flow, , Flow Control
4011 @section About @code{screen} flow control settings
4012 Each window has a flow-control setting that determines how screen deals
4013 with the XON and XOFF characters (and perhaps the interrupt character).
4014 When flow-control is turned off, screen ignores the XON and XOFF
4015 characters, which allows the user to send them to the current program by
4016 simply typing them (useful for the @code{emacs} editor, for instance).
4017 The trade-off is that it will take longer for output from a
4018 ``normal'' program to pause in response to an XOFF. With
4019 flow-control turned on, XON and XOFF characters are used to immediately
4020 pause the output of the current window. You can still send these
4021 characters to the current program, but you must use the appropriate
4022 two-character screen commands (typically @kbd{C-a q} (xon) and @kbd{C-a
4023 s} (xoff)). The xon/xoff commands are also useful for typing C-s and
4024 C-q past a terminal that intercepts these characters.
4026 Each window has an initial flow-control value set with either the
4027 @samp{-f} option or the @code{defflow} command. By default the
4028 windows are set to automatic flow-switching. It can then be toggled
4029 between the three states 'fixed on', 'fixed off' and 'automatic'
4030 interactively with the @code{flow} command bound to @kbd{C-a f}.
4032 The automatic flow-switching mode deals with flow control using the
4033 TIOCPKT mode (like @code{rlogin} does). If the tty driver does not
4034 support TIOCPKT, screen tries to determine the right mode based on the
4035 current setting of the application keypad --- when it is enabled,
4036 flow-control is turned off and visa versa. Of course, you can still
4037 manipulate flow-control manually when needed.
4039 If you're running with flow-control enabled and find that pressing the
4040 interrupt key (usually C-c) does not interrupt the display until another
4041 6-8 lines have scrolled by, try running screen with the @samp{interrupt}
4042 option (add the @samp{interrupt} flag to the @code{flow} command in your
4043 .screenrc, or use the @samp{-i} command-line option). This causes the
4044 output that @code{screen} has accumulated from the interrupted program
4045 to be flushed. One disadvantage is that the virtual terminal's memory
4046 contains the non-flushed version of the output, which in rare cases can
4047 cause minor inaccuracies in the output. For example, if you switch
4048 screens and return, or update the screen with @kbd{C-a l} you would see
4049 the version of the output you would have gotten without @samp{interrupt}
4050 being on. Also, you might need to turn off flow-control (or use
4051 auto-flow mode to turn it off automatically) when running a program that
4052 expects you to type the interrupt character as input, as the
4053 @samp{interrupt} parameter only takes effect when flow-control is
4054 enabled. If your program's output is interrupted by mistake, a simple
4055 refresh of the screen with @kbd{C-a l} will restore it. Give each mode
4056 a try, and use whichever mode you find more comfortable.
4058 @node Flow, XON/XOFF, Flow Control Summary, Flow Control
4060 @deffn Command defflow fstate [interrupt]
4062 Same as the @code{flow} command except that the default setting for new
4063 windows is changed. Initial setting is `auto'.
4064 Specifying @code{flow auto interrupt} has the same effect as the
4065 command-line options @samp{-fa} and @samp{-i}.
4066 Note that if @samp{interrupt} is enabled, all existing displays are
4067 changed immediately to forward interrupt signals.
4072 @deffn Command flow [fstate]
4073 (@kbd{C-a f}, @kbd{C-a C-f})@*
4074 Sets the flow-control mode for this window to @var{fstate}, which can be
4075 @samp{on}, @samp{off} or @samp{auto}.
4076 Without parameters it cycles the current window's
4077 flow-control setting. Default is set by `defflow'.
4080 @node XON/XOFF, , Flow, Flow Control
4081 @section XON and XOFF
4085 (@kbd{C-a q}, @kbd{C-a C-q})@*
4086 Send a ^Q (ASCII XON) to the program in the current window. Redundant
4087 if flow control is set to @samp{off} or @samp{auto}.
4093 (@kbd{C-a s}, @kbd{C-a C-s})@*
4094 Send a ^S (ASCII XOFF) to the program in the current window.
4097 @node Termcap, Message Line, Flow Control, Top
4100 @code{Screen} demands the most out of your terminal so that it can
4101 perform its VT100 emulation most efficiently. These functions provide
4102 means for tweaking the termcap entries for both your physical terminal
4103 and the one simulated by @code{screen}.
4106 * Window Termcap:: Choosing a termcap entry for the window.
4107 * Dump Termcap:: Write out a termcap entry for the window.
4108 * Termcap Syntax:: The @code{termcap} and @code{terminfo} commands.
4109 * Termcap Examples:: Uses for @code{termcap}.
4110 * Special Capabilities:: Non-standard capabilities used by @code{screen}.
4111 * Autonuke:: Flush unseen output
4112 * Obuflimit:: Allow pending output when reading more
4113 * Character Translation:: Emulating fonts and charsets.
4116 @node Window Termcap, Dump Termcap, , Termcap
4117 @section Choosing the termcap entry for a window
4118 Usually @code{screen} tries to emulate as much of the VT100/ANSI
4119 standard as possible. But if your terminal lacks certain capabilities
4120 the emulation may not be complete. In these cases @code{screen} has to
4121 tell the applications that some of the features are missing. This is no
4122 problem on machines using termcap, because @code{screen} can use the
4123 @code{$TERMCAP} variable to customize the standard screen termcap.
4125 But if you do a rlogin on another machine or your machine supports only
4126 terminfo this method fails. Because of this @code{screen} offers a way
4127 to deal with these cases. Here is how it works:
4129 When @code{screen} tries to figure out a terminal name for itself, it
4130 first looks for an entry named @code{screen.@var{term}}, where
4131 @var{term} is the contents of your @code{$TERM} variable. If no such entry
4132 exists, @code{screen} tries @samp{screen} (or @samp{screen-w}, if the
4133 terminal is wide (132 cols or more)). If even this entry cannot be
4134 found, @samp{vt100} is used as a substitute.
4136 The idea is that if you have a terminal which doesn't support an
4137 important feature (e.g. delete char or clear to EOS) you can build a new
4138 termcap/terminfo entry for @code{screen} (named
4139 @samp{screen.@var{dumbterm}}) in which this capability has been
4140 disabled. If this entry is installed on your machines you are able to
4141 do a rlogin and still keep the correct termcap/terminfo entry. The
4142 terminal name is put in the @code{$TERM} variable of all new windows.
4143 @code{screen} also sets the @code{$TERMCAP} variable reflecting the
4144 capabilities of the virtual terminal emulated.
4145 Furthermore, the variable @code{$WINDOW} is set to the window number of each
4148 The actual set of capabilities supported by the virtual terminal depends
4149 on the capabilities supported by the physical terminal. If, for
4150 instance, the physical terminal does not support underscore mode,
4151 @code{screen} does not put the @samp{us} and @samp{ue} capabilities into
4152 the window's @code{$TERMCAP} variable, accordingly. However, a minimum number
4153 of capabilities must be supported by a terminal in order to run
4154 @code{screen}; namely scrolling, clear screen, and direct cursor
4155 addressing (in addition, @code{screen} does not run on hardcopy
4156 terminals or on terminals that over-strike).
4158 Also, you can customize the @code{$TERMCAP} value used by @code{screen} by
4159 using the @code{termcap} command, or by defining the variable
4160 @code{$SCREENCAP} prior to startup. When the latter defined, its value will be
4161 copied verbatim into each window's @code{$TERMCAP} variable. This can either
4162 be the full terminal definition, or a filename where the terminal
4163 @samp{screen} (and/or @samp{screen-w}) is defined.
4165 Note that @code{screen} honors the @code{terminfo} command if the system
4166 uses the terminfo database rather than termcap. On such machines the
4167 @code{$TERMCAP} variable has no effect and you must use the
4168 @code{dumptermcap} command (@pxref{Dump Termcap}) and the @code{tic}
4169 program to generate terminfo entries for @code{screen} windows.
4171 When the boolean @samp{G0} capability is present in the termcap entry
4172 for the terminal on which @code{screen} has been called, the terminal
4173 emulation of @code{screen} supports multiple character sets. This
4174 allows an application to make use of, for instance, the VT100 graphics
4175 character set or national character sets. The following control
4176 functions from ISO 2022 are supported: @samp{lock shift G0} (@samp{SI}),
4177 @samp{lock shift G1} (@samp{SO}), @samp{lock shift G2}, @samp{lock shift
4178 G3}, @samp{single shift G2}, and @samp{single shift G3}. When a virtual
4179 terminal is created or reset, the ASCII character set is designated as
4180 @samp{G0} through @samp{G3}. When the @samp{G0} capability is present,
4181 screen evaluates the capabilities @samp{S0}, @samp{E0}, and @samp{C0} if
4182 present. @samp{S0} is the sequence the terminal uses to enable and start
4183 the graphics character set rather than @samp{SI}. @samp{E0} is the
4184 corresponding replacement for @samp{SO}. @samp{C0} gives a character by
4185 character translation string that is used during semi-graphics mode.
4186 This string is built like the @samp{acsc} terminfo capability.
4188 When the @samp{po} and @samp{pf} capabilities are present in the
4189 terminal's termcap entry, applications running in a @code{screen} window
4190 can send output to the printer port of the terminal. This allows a user
4191 to have an application in one window sending output to a printer
4192 connected to the terminal, while all other windows are still active (the
4193 printer port is enabled and disabled again for each chunk of output).
4194 As a side-effect, programs running in different windows can send output
4195 to the printer simultaneously. Data sent to the printer is not
4196 displayed in the window. The @code{info} command displays a line starting
4197 with @samp{PRIN} while the printer is active.
4199 Some capabilities are only put into the @code{$TERMCAP} variable of the virtual
4200 terminal if they can be efficiently implemented by the physical
4201 terminal. For instance, @samp{dl} (delete line) is only put into the
4202 @code{$TERMCAP} variable if the terminal supports either delete line itself or
4203 scrolling regions. Note that this may provoke confusion, when the
4204 session is reattached on a different terminal, as the value of @code{$TERMCAP}
4205 cannot be modified by parent processes. You can force @code{screen} to
4206 include all capabilities in @code{$TERMCAP} with the @samp{-a}
4207 command-line option (@pxref{Invoking Screen}).
4209 The "alternate screen" capability is not enabled by default.
4210 Set the @code{altscreen} @file{.screenrc} command to enable it.
4212 @node Dump Termcap, Termcap Syntax, Window Termcap, Termcap
4213 @section Write out the window's termcap entry
4215 @deffn Command dumptermcap
4217 Write the termcap entry for the virtual terminal optimized for the
4218 currently active window to the file @file{.termcap} in the user's
4219 @file{$HOME/.screen} directory (or wherever @code{screen} stores its
4220 sockets. @pxref{Files}). This termcap entry is identical to
4221 the value of the environment variable @code{$TERMCAP} that is set up by
4222 @code{screen} for each window. For terminfo based systems you will need
4223 to run a converter like @code{captoinfo} and then compile the entry with
4227 @node Termcap Syntax, Termcap Examples, Dump Termcap, Termcap
4228 @section The @code{termcap} command
4229 @deffn Command termcap term terminal-tweaks [window-tweaks]
4230 @deffnx Command terminfo term terminal-tweaks [window-tweaks]
4231 @deffnx Command termcapinfo term terminal-tweaks [window-tweaks]
4233 Use this command to modify your terminal's termcap entry without going
4234 through all the hassles involved in creating a custom termcap entry.
4235 Plus, you can optionally customize the termcap generated for the
4237 You have to place these commands in one of the screenrc startup files, as they
4238 are meaningless once the terminal emulator is booted.
4240 If your system uses the terminfo database rather than termcap,
4241 @code{screen} will understand the @code{terminfo} command, which has the
4242 same effects as the @code{termcap} command. Two separate commands are
4243 provided, as there are subtle syntactic differences, e.g. when parameter
4244 interpolation (using @samp{%}) is required. Note that the termcap names of
4245 the capabilities should also be used with the @code{terminfo} command.
4247 In many cases, where the arguments are valid in both terminfo and termcap
4248 syntax, you can use the command @code{termcapinfo}, which is just a
4249 shorthand for a pair of @code{termcap} and @code{terminfo} commands with
4250 identical arguments.
4253 The first argument specifies which terminal(s) should be affected by
4254 this definition. You can specify multiple terminal names by separating
4255 them with @samp{|}s. Use @samp{*} to match all terminals and @samp{vt*}
4256 to match all terminals that begin with @samp{vt}.
4258 Each @var{tweak} argument contains one or more termcap defines
4259 (separated by @samp{:}s) to be inserted at the start of the appropriate
4260 termcap entry, enhancing it or overriding existing values. The first
4261 tweak modifies your terminal's termcap, and contains definitions that
4262 your terminal uses to perform certain functions. Specify a null string
4263 to leave this unchanged (e.g. ""). The second (optional) tweak modifies
4264 all the window termcaps, and should contain definitions that screen
4265 understands (@pxref{Virtual Terminal}).
4267 @node Termcap Examples, Special Capabilities, Termcap Syntax, Termcap
4268 @section Termcap Examples
4272 termcap xterm* xn:hs@@
4276 Informs @code{screen} that all terminals that begin with @samp{xterm}
4277 have firm auto-margins that allow the last position on the screen to be
4278 updated (xn), but they don't really have a status line (no 'hs' --
4279 append @samp{@@} to turn entries off). Note that we assume @samp{xn} for
4280 all terminal names that start with @samp{vt}, but only if you don't
4281 specify a termcap command for that terminal.
4285 termcap vt102|vt220 Z0=\E[?3h:Z1=\E[?3l
4289 Specifies the firm-margined @samp{xn} capability for all terminals that
4290 begin with @samp{vt}, and the second line will also add the
4291 escape-sequences to switch into (Z0) and back out of (Z1)
4292 132-character-per-line mode if this is a VT102 or VT220. (You must
4293 specify Z0 and Z1 in your termcap to use the width-changing commands.)
4296 termcap vt100 "" l0=PF1:l1=PF2:l2=PF3:l3=PF4
4300 This leaves your vt100 termcap alone and adds the function key labels to
4301 each window's termcap entry.
4304 termcap h19|z19 am@@:im=\E@@:ei=\EO dc=\E[P
4308 Takes a h19 or z19 termcap and turns off auto-margins (am@@) and enables
4309 the insert mode (im) and end-insert (ei) capabilities (the @samp{@@} in
4310 the @samp{im} string is after the @samp{=}, so it is part of the
4311 string). Having the @samp{im} and @samp{ei} definitions put into your
4312 terminal's termcap will cause screen to automatically advertise the
4313 character-insert capability in each window's termcap. Each window will
4314 also get the delete-character capability (dc) added to its termcap,
4315 which screen will translate into a line-update for the terminal (we're
4316 pretending it doesn't support character deletion).
4318 If you would like to fully specify each window's termcap entry, you
4319 should instead set the @code{$SCREENCAP} variable prior to running
4320 @code{screen}. @xref{Virtual Terminal}, for the details of the
4321 @code{screen} terminal emulation. @xref{Top, , Termcap, termcap, The
4322 Termcap Manual}, for more information on termcap definitions.
4324 @node Special Capabilities, Autonuke, Termcap Examples, Termcap
4325 @section Special Terminal Capabilities
4326 @cindex terminal capabilities
4327 @cindex capabilities
4328 The following table describes all terminal capabilities that are
4329 recognized by @code{screen} and are not in the termcap manual
4330 (@pxref{Top, , Termcap, termcap, The Termcap Manual}).
4331 You can place these capabilities in your termcap entries (in
4332 @file{/etc/termcap}) or use them with the commands @code{termcap},
4333 @code{terminfo} and @code{termcapinfo} in your @code{screenrc} files. It is
4334 often not possible to place these capabilities in the terminfo database.
4338 Terminal has VT100 style margins (`magic margins'). Note that
4339 this capability is obsolete --- @code{screen} now uses the standard
4344 Change width to 132 columns.
4348 Change width to 80 columns.
4352 Resize display. This capability has the desired width and height as
4353 arguments. SunView(tm) example: @samp{\E[8;%d;%dt}.
4357 Terminal doesn't need flow control. Send ^S and ^Q direct to
4358 the application. Same as @code{flow off}. The opposite of this
4359 capability is @samp{nx}.
4363 Terminal can deal with ISO 2022 font selection sequences.
4367 Switch charset @samp{G0} to the specified charset. Default
4372 Switch charset @samp{G0} back to standard charset. Default
4377 Use the string as a conversion table for font 0. See
4378 the @samp{ac} capability for more details.
4382 Switch cursor-keys to application mode.
4386 Switch cursor-keys to cursor mode.
4390 Enable autonuke for displays of this terminal type.
4395 Set the output buffer limit. See the @samp{obuflimit} command
4396 (@pxref{Obuflimit}) for more details.
4400 Set the encoding of the terminal. See the @samp{encoding} command
4401 (@pxref{Character Processing}) for valid encodings.
4405 Change character foreground color in an ANSI conform way. This
4406 capability will almost always be set to @samp{\E[3%dm}
4407 (@samp{\E[3%p1%dm} on terminfo machines).
4411 Same as @samp{AF}, but change background color.
4415 Does understand ANSI set default fg/bg color (@samp{\E[39m / \E[49m}).
4419 Describe a translation of characters to strings depending on the
4420 current font. (@pxref{Character Translation}).
4424 Terminal understands special xterm sequences (OSC, mouse tracking).
4428 Terminal needs bold to display high-intensity colors (e.g. Eterm).
4432 Add missing capabilities to the termcap/info entry. (Set by default).
4435 @node Autonuke, Obuflimit, Special Capabilities, Termcap
4437 @deffn Command autonuke @var{state}
4439 Sets whether a clear screen sequence should nuke all the output
4440 that has not been written to the terminal. @xref{Obuflimit}.
4441 This property is set per display, not per window.
4444 @deffn Command defautonuke @var{state}
4446 Same as the @code{autonuke} command except that the default setting for
4447 new displays is also changed. Initial setting is @code{off}.
4448 Note that you can use the special @code{AN} terminal capability if you
4449 want to have a terminal type dependent setting.
4452 @node Obuflimit, Character Translation, Autonuke, Termcap
4454 @deffn Command obuflimit [@var{limit}]
4456 If the output buffer contains more bytes than the specified limit, no
4457 more data will be read from the windows. The default value is 256. If
4458 you have a fast display (like @code{xterm}), you can set it to some
4459 higher value. If no argument is specified, the current setting is displayed.
4460 This property is set per display, not per window.
4463 @deffn Command defobuflimit @var{limit}
4465 Same as the @code{obuflimit} command except that the default setting for new
4466 displays is also changed. Initial setting is 256 bytes. Note that you can use
4467 the special @code{OL} terminal capability if you want to have a terminal
4468 type dependent limit.
4471 @node Character Translation, , Obuflimit, Termcap
4472 @section Character Translation
4473 @code{Screen} has a powerful mechanism to translate characters to
4474 arbitrary strings depending on the current font and terminal type.
4475 Use this feature if you want to work with a common standard character
4476 set (say ISO8851-latin1) even on terminals that scatter the more
4477 unusual characters over several national language font pages.
4482 XC=@var{<charset-mapping>}@{,,@var{<charset-mapping>}@}
4483 @var{<charset-mapping>} := @var{<designator>}@var{<template>}@{,@var{<mapping>}@}
4484 @var{<mapping>} := @var{<char-to-be-mapped>}@var{<template-arg>}
4487 The things in braces may be repeated any number of times.
4489 A @var{<charset-mapping>} tells screen how to map characters
4490 in font @var{<designator>} (@samp{B}: Ascii, @samp{A}: UK,
4491 @samp{K}: german, etc.)
4492 to strings. Every @var{<mapping>} describes to what string a single
4493 character will be translated. A template mechanism is used, as
4494 most of the time the codes have a lot in common (for example
4495 strings to switch to and from another charset). Each occurrence
4496 of @samp{%} in @var{<template>} gets substituted with the
4498 specified together with the character. If your strings are not
4499 similar at all, then use @samp{%} as a template and place the full
4500 string in @var{<template-arg>}. A quoting mechanism was added to make
4501 it possible to use a real @samp{%}. The @samp{\} character quotes the
4502 special characters @samp{\}, @samp{%}, and @samp{,}.
4507 termcap hp700 'XC=B\E(K%\E(B,\304[,\326\\\\,\334]'
4510 This tells @code{screen}, how to translate ISOlatin1 (charset @samp{B})
4511 upper case umlaut characters on a @code{hp700} terminal that has a
4512 German charset. @samp{\304} gets translated to
4513 @samp{\E(K[\E(B} and so on.
4514 Note that this line gets parsed *three* times before the internal
4515 lookup table is built, therefore a lot of quoting is needed to
4516 create a single @samp{\}.
4518 Another extension was added to allow more emulation: If a mapping
4519 translates the unquoted @samp{%} char, it will be sent to the terminal
4520 whenever screen switches to the corresponding @var{<designator>}.
4522 special case the template is assumed to be just @samp{%} because
4523 the charset switch sequence and the character mappings normally
4524 haven't much in common.
4526 This example shows one use of the extension:
4528 termcap xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334'
4531 Here, a part of the German (@samp{K}) charset is emulated on an xterm.
4532 If screen has to change to the @samp{K} charset, @samp{\E(B} will be
4534 to the terminal, i.e. the ASCII charset is used instead. The
4535 template is just @samp{%}, so the mapping is straightforward:
4536 @samp{[} to @samp{\304}, @samp{\} to @samp{\326}, and @samp{]} to
4539 @node Message Line, Logging, Termcap, Top
4540 @chapter The Message Line
4541 @cindex message line
4543 @code{Screen} displays informational messages and other diagnostics in a
4544 @dfn{message line} at the bottom of the screen. If your terminal has a
4545 status line defined in its termcap, screen will use this for displaying
4546 its messages, otherwise the last line of the screen will be temporarily
4547 overwritten and output will be momentarily interrupted. The message
4548 line is automatically removed after a few seconds delay, but it can also
4549 be removed early (on terminals without a status line) by beginning to
4553 * Privacy Message:: Using the message line from your program.
4554 * Hardware Status Line:: Use the terminal's hardware status line.
4555 * Last Message:: Redisplay the last message.
4556 * Message Wait:: Control how long messages are displayed.
4559 @node Privacy Message, Hardware Status Line, , Message Line
4560 @section Using the message line from your program
4561 The message line facility can be used by an application running in the
4562 current window by means of the ANSI @dfn{Privacy message} control
4563 sequence. For instance, from within the shell, try something like:
4566 echo "@value{esc}^Hello world from window $WINDOW@value{esc}\"
4569 where @samp{@value{esc}} is ASCII ESC and the @samp{^} that follows it
4570 is a literal caret or up-arrow.
4572 @node Hardware Status Line, Last Message, Privacy Message, Message Line
4573 @section Hardware Status Line
4574 @deffn Command hardstatus [state]
4575 @deffnx Command hardstatus [@code{always}]@code{lastline}|@code{message}|@code{ignore} [string]
4576 @deffnx Command hardstatus @code{string} [string]
4578 This command configures the use and emulation of the terminal's
4579 hardstatus line. The first form toggles whether @code{screen}
4580 will use the hardware status line to display messages. If the
4581 flag is set to @samp{off}, these messages
4582 are overlaid in reverse video mode at the display line. The default
4583 setting is @samp{on}.
4585 The second form tells screen what to do if the terminal doesn't
4586 have a hardstatus line (i.e. the termcap/terminfo capabilities
4587 "hs", "ts", "fs" and "ds" are not set). If the type
4588 @code{lastline} is used, screen will reserve the last line of the
4589 display for the hardstatus. @code{message} uses
4590 @code{screen}'s message mechanism and
4591 @code{ignore} tells @code{screen} never to display the hardstatus.
4592 If you prepend the word @code{always} to the type (e.g., @code{alwayslastline}), @code{screen} will use
4593 the type even if the terminal supports a hardstatus line.
4595 The third form specifies the contents of the hardstatus line.
4596 @code{%h} is used as default string, i.e., the stored hardstatus of the
4597 current window (settable via @samp{ESC]0;^G} or @samp{ESC_\\}) is
4599 You can customize this to any string you like including
4600 string escapes (@pxref{String Escapes}).
4602 out the argument @var{string}, the current string is displayed.
4604 You can mix the second and third form by providing the string as
4605 additional argument.
4608 @node Last Message, Message Wait, Hardware Status Line, Message Line
4609 @section Display Last Message
4612 @deffn Command lastmsg
4613 (@kbd{C-a m}, @kbd{C-a C-m})@*
4614 Repeat the last message displayed in the message line. Useful if you're
4615 typing when a message appears, because (unless your terminal has a
4616 hardware status line) the message goes away when you press a key.
4619 @node Message Wait, , Last Message, Message Line
4620 @section Message Wait
4621 @deffn Command msgminwait sec
4623 Defines the time @code{screen} delays a new message when another is
4624 currently displayed. Defaults to 1 second.
4627 @deffn Command msgwait sec
4629 Defines the time a message is displayed, if @code{screen} is not
4630 disturbed by other activity. Defaults to 5 seconds.
4633 @node Logging, Startup, Message Line, Top
4636 This section describes the commands for keeping a record of your session.
4639 * Hardcopy:: Dump the current screen to a file
4640 * Log:: Log the output of a window to a file
4643 @node Hardcopy, Log, , Logging
4646 @deffn Command hardcopy [-h] [@var{file}]
4648 Writes out the currently displayed image to the file @var{file}, or,
4649 if no filename is specified, to @file{hardcopy.@var{n}}
4650 in the default directory, where @var{n} is the number of the
4651 current window. This either appends or overwrites the file if it
4652 exists, as determined by the @code{hardcopy_append} command.
4653 If the option @code{-h} is specified, dump also the
4654 contents of the scrollback buffer.
4657 @deffn Command hardcopy_append state
4659 If set to @samp{on}, @code{screen} will append to the
4660 @file{hardcopy.@var{n}} files created by the command @code{hardcopy};
4661 otherwise, these files are overwritten each time.
4664 @deffn Command hardcopydir directory
4666 Defines a directory where hardcopy files will be placed.
4667 If unset, hardcopys are dumped in screen's current working
4671 @node Log, , Hardcopy, Logging
4674 @deffn Command deflog state
4676 Same as the @code{log} command except that the default setting for new
4677 windows is changed. Initial setting is `off'.
4681 @deffn Command log [state]
4683 Begins/ends logging of the current window to the file
4684 @file{screenlog.@var{n}} in the window's default directory, where
4685 @var{n} is the number of the current window.
4686 This filename can be changed with the @samp{logfile} command.
4687 If no parameter is given,
4688 the logging state is toggled. The session log is
4689 appended to the previous contents of the file if it already exists. The
4690 current contents and the contents of the scrollback history are not
4691 included in the session log. Default is @samp{off}.
4694 @deffn Command logfile filename
4695 @deffnx Command logfile flush secs
4697 Defines the name the log files will get. The default is @samp{screenlog.%n}.
4698 The second form changes the number of seconds @code{screen}
4699 will wait before flushing the logfile buffer to the file-system. The
4700 default value is 10 seconds.
4703 @deffn Command logtstamp [state]
4704 @deffnx Command logtstamp @code{after} secs
4705 @deffnx Command logtstamp @code{string} string
4707 This command controls logfile time-stamp mechanism of screen. If
4708 time-stamps are turned @samp{on}, screen adds a string containing
4709 the current time to the logfile after two minutes of inactivity.
4710 When output continues and more than another two minutes have passed,
4711 a second time-stamp is added to document the restart of the
4712 output. You can change this timeout with the second form
4713 of the command. The third form is used for customizing the time-stamp
4714 string (@samp{-- %n:%t -- time-stamp -- %M/%d/%y %c:%s --\n} by
4718 @node Startup, Miscellaneous, Logging, Top
4721 This section describes commands which are only useful in the
4722 @file{.screenrc} file, for use at startup.
4725 * echo:: Display a message.
4726 * sleep:: Pause execution of the @file{.screenrc}.
4727 * Startup Message:: Control display of the copyright notice.
4730 @node echo, sleep, , Startup
4732 @deffn Command echo [@samp{-n}] message
4734 The echo command may be used to annoy @code{screen} users with a
4735 'message of the day'. Typically installed in a global screenrc.
4736 The option @samp{-n} may be used to suppress the line feed.
4737 See also @code{sleep}.
4738 Echo is also useful for online checking of environment variables.
4741 @node sleep, Startup Message, echo, Startup
4743 @deffn Command sleep num
4745 This command will pause the execution of a .screenrc file for @var{num}
4746 seconds. Keyboard activity will end the sleep. It may be used to give
4747 users a chance to read the messages output by @code{echo}.
4750 @node Startup Message, , sleep, Startup
4751 @section Startup Message
4752 @deffn Command startup_message state
4754 Select whether you want to see the copyright notice during startup.
4755 Default is @samp{on}, as you probably noticed.
4758 @node Miscellaneous, String Escapes, Startup, Top
4759 @chapter Miscellaneous commands
4761 The commands described here do not fit well under any of the other
4765 * At:: Execute a command at other displays or windows.
4766 * Break:: Send a break signal to the window.
4767 * Debug:: Suppress/allow debugging output.
4768 * License:: Display the disclaimer page.
4769 * Nethack:: Use @code{nethack}-like error messages.
4770 * Nonblock:: Disable flow-control to a display.
4771 * Number:: Change the current window's number.
4772 * Silence:: Notify on inactivity.
4773 * Time:: Display the time and load average.
4774 * Verbose:: Display window creation commands.
4775 * Version:: Display the version of @code{screen}.
4776 * Zombie:: Keep dead windows.
4777 * Printcmd:: Set command for VT100 printer port emulation.
4778 * Rendition:: Change text attributes in caption for flagged windows.
4779 * Sorendition:: Change the text highlighting method.
4780 * Attrcolor:: Map attributes to colors.
4781 * Setsid:: Change process group management.
4782 * Eval:: Parse and execute arguments.
4783 * Maxwin:: Set the maximum window number.
4784 * Backtick:: Program a command for a backtick string escape.
4785 * Screen Saver:: Define a screen safer.
4786 * Zmodem:: Define how screen treats zmodem requests.
4787 * Mousetrack:: Set whether screen should track mouse events.
4790 @node At, Break, , Miscellaneous
4792 @deffn Command at [identifier][#|*|%] command [args]
4794 Execute a command at other displays or windows as if it had been entered there.
4795 @code{At} changes the context (the `current window' or `current display'
4796 setting) of the command. If the first parameter describes a non-unique context,
4797 the command will be executed multiple times. If the first parameter is of the
4798 form @samp{@var{identifier}*} then identifier is matched against user names.
4799 The command is executed once for each display of the selected user(s).
4800 If the first parameter is of the form @samp{@var{identifier}%} identifier is
4801 matched against displays. Displays are named after the ttys they attach. The
4802 prefix @samp{/dev/} or @samp{/dev/tty} may be omitted from the identifier.
4803 If @var{identifier} has a @code{#} or nothing appended it is matched against
4804 window numbers and titles. Omitting an identifier in front of the @code{#},
4805 @code{*} or @code{%} character selects all users, displays or windows because
4806 a prefix-match is performed. Note that on the affected display(s) a short
4807 message will describe what happened.
4808 Note that the @code{#} character works as a comment introducer when it is
4809 preceded by whitespace. This can be escaped by prefixing @code{#} with a
4811 Permission is checked for the initiator of the @code{at} command, not for the
4812 owners of the affected display(s).
4814 When matching against windows, the command is executed at least
4815 once per window. Commands that change the internal arrangement of windows
4816 (like @code{other}) may be called again. In shared windows the command will
4817 be repeated for each attached display. Beware, when issuing toggle commands
4819 Some commands (e.g. @code{\*Qprocess}) require
4820 that a display is associated with the target windows. These commands may not
4821 work correctly under @code{at} looping over windows.
4824 @node Break, Debug, At, Miscellaneous
4828 @deffn Command break [duration]
4829 (@kbd{C-a b}, @kbd{C-a C-b})@*
4830 Send a break signal for @var{duration}*0.25 seconds to this window.
4831 For non-Posix systems the time interval is rounded up to full seconds.
4832 Most useful if a character device is attached to the window rather than
4833 a shell process (@pxref{Window Types}). The maximum duration of
4834 a break signal is limited to 15 seconds.
4838 @deffn Command pow_break
4840 Reopen the window's terminal line and send a break condition.
4843 @deffn Command breaktype [tcsendbreak|TIOCSBRK|TCSBRK]
4845 Choose one of the available methods of generating a break signal for
4846 terminal devices. This command should affect the current window only.
4847 But it still behaves identical to @code{defbreaktype}. This will be changed in
4849 Calling @code{breaktype} with no parameter displays the break setting for the
4853 @deffn Command defbreaktype [tcsendbreak|TIOCSBRK|TCSBRK]
4855 Choose one of the available methods of generating a break signal for
4856 terminal devices opened afterwards. The preferred methods are
4857 @code{tcsendbreak} and
4858 @code{TIOCSBRK}. The third, @code{TCSBRK}, blocks the complete @code{screen}
4859 session for the duration of the break, but it may be the only way to
4860 generate long breaks. @code{tcsendbreak} and @code{TIOCSBRK} may or may not
4861 produce long breaks with spikes (e.g. 4 per second). This is not only system
4862 dependent, this also differs between serial board drivers.
4863 Calling @code{defbreaktype} with no parameter displays the current setting.
4866 @node Debug, License, Break, Miscellaneous
4868 @deffn Command debug [on|off]
4870 Turns runtime debugging on or off. If @code{screen} has been compiled with
4871 option @code{-DDEBUG} debugging is available and is turned on per default.
4872 Note that this command only affects debugging output from the main
4873 @samp{SCREEN} process correctly. Debug output from attacher processes can only
4874 be turned off once and forever.
4877 @node License, Nethack, Debug, Miscellaneous
4880 @deffn Command license
4882 Display the disclaimer page. This is done whenever @code{screen} is
4883 started without options, which should be often enough.
4886 @node Nethack, Nonblock, License, Miscellaneous
4888 @deffn Command nethack state
4890 Changes the kind of error messages used by @code{screen}. When you are
4891 familiar with the game @code{nethack}, you may enjoy the nethack-style
4892 messages which will often blur the facts a little, but are much funnier
4893 to read. Anyway, standard messages often tend to be unclear as well.
4895 This option is only available if @code{screen} was compiled with the
4896 NETHACK flag defined (@pxref{Installation}). The default setting is then
4897 determined by the presence of the environment variable
4898 @code{$NETHACKOPTIONS} and the file @code{~/.nethackrc} - if either one is
4899 present, the default is @code{on}.
4902 @node Nonblock, Number, Nethack, Miscellaneous
4904 @deffn Command nonblock [@var{state}|@var{numsecs}]
4905 Tell screen how to deal with user interfaces (displays) that cease to
4906 accept output. This can happen if a user presses ^S or a TCP/modem
4907 connection gets cut but no hangup is received. If nonblock is
4908 @code{off} (this is the default) screen waits until the display
4909 restarts to accept the output. If nonblock is @code{on}, screen
4910 waits until the timeout is reached (@code{on} is treated as 1s). If the
4911 display still doesn't receive characters, screen will consider
4912 it ``blocked'' and stop sending characters to it. If at
4913 some time it restarts to accept characters, screen will unblock
4914 the display and redisplay the updated window contents.
4917 @deffn Command defnonblock @var{state}|@var{numsecs}
4918 Same as the @code{nonblock} command except that the default setting for
4919 displays is changed. Initial setting is @code{off}.
4922 @node Number, Silence, Nonblock, Miscellaneous
4925 @deffn Command number [[+|-]@var{n}]
4927 Change the current window's number. If the given number @var{n} is already
4928 used by another window, both windows exchange their numbers. If no argument is
4929 specified, the current window number (and title) is shown. Using either a
4930 plus (`+') or minus (`-') will change the window's number by the relative
4934 @node Silence, Time, Number, Miscellaneous
4937 @deffn Command silence [@var{state}|@var{sec}]
4939 Toggles silence monitoring of windows. When silence is turned on and an
4940 affected window is switched into the background, you will receive the
4941 silence notification message in the status line after a specified period
4942 of inactivity (silence). The default timeout can be changed with the
4943 @code{silencewait} command or by specifying a number of seconds instead of
4944 @code{on} or @code{off}. Silence is initially off for all windows.
4947 @deffn Command defsilence state
4949 Same as the @code{silence} command except that the default setting for
4950 new windows is changed. Initial setting is `off'.
4953 @deffn Command silencewait @var{seconds}
4955 Define the time that all windows monitored for silence should wait
4956 before displaying a message. Default is 30 seconds.
4959 @node Time, Verbose, Silence, Miscellaneous
4963 @deffn Command time [@var{string}]
4964 (@kbd{C-a t}, @kbd{C-a C-t})@*
4965 Uses the message line to display the time of day, the host name, and the
4966 load averages over 1, 5, and 15 minutes (if this is available on your
4967 system). For window-specific information use @code{info} (@pxref{Info}).
4968 If a @var{string} is specified, it changes the format of the time report
4969 like it is described in the string escapes chapter (@pxref{String Escapes}). Screen uses a default of @samp{%c:%s %M %d %H%? %l%?}.
4972 @node Verbose, Version, Time, Miscellaneous
4974 @deffn Command verbose [on|off]
4975 If verbose is switched on, the command name is echoed, whenever a window
4976 is created (or resurrected from zombie state). Default is off.
4977 Without a parameter, the current setting is shown.
4980 @node Version, Zombie, Verbose, Miscellaneous
4983 @deffn Command version
4985 Display the version and modification date in the message line.
4988 @node Zombie, Printcmd, Version, Miscellaneous
4990 @deffn Command zombie [@var{keys} [onerror] ]
4991 @deffnx Command defzombie [@var{keys}]
4993 Per default windows are removed from the window list as soon as the
4994 windows process (e.g. shell) exits. When a string of two keys is
4995 specified to the zombie command, `dead' windows will remain in the list.
4996 The @code{kill} command may be used to remove the window. Pressing the first key
4997 in the dead window has the same effect. Pressing the second key, however,
4998 screen will attempt to resurrect the window. The process that was initially
4999 running in the window will be launched again. Calling @code{zombie} without
5000 parameters will clear the zombie setting, thus making windows disappear when
5001 the process terminates.
5003 As the zombie setting is affected globally for all windows, this command
5004 should only be called @code{defzombie}. Until we need this as a per window
5005 setting, the commands @code{zombie} and @code{defzombie} are synonymous.
5007 Optionally you can put the word @code{onerror} after the keys. This will
5008 cause screen to monitor exit status of the process running in the window.
5009 If it exits normally ('0'), the window disappears. Any other exit value
5010 causes the window to become a zombie.
5013 @node Printcmd, Rendition, Zombie, Miscellaneous
5015 @deffn Command printcmd [@var{cmd}]
5017 If @var{cmd} is not an empty string, screen will not use the terminal
5018 capabilities @code{po/pf} for printing if it detects an ansi print
5019 sequence @code{ESC [ 5 i}, but pipe the output into @var{cmd}.
5020 This should normally be a command like @samp{lpr} or
5021 @samp{cat > /tmp/scrprint}.
5022 @code{Printcmd} without an argument displays the current setting.
5023 The ansi sequence @code{ESC \} ends printing and closes the pipe.
5025 Warning: Be careful with this command! If other user have write
5026 access to your terminal, they will be able to fire off print commands.
5029 @node Rendition, Sorendition, Printcmd, Miscellaneous
5031 @deffn Command rendition bell | monitor | so @var{attr} [@var{color}]
5033 Change the way screen renders the titles of windows that have monitor
5034 or bell flags set in caption or hardstatus or windowlist.
5036 about string escapes (@pxref{String Escapes}) for the syntax of
5037 the modifiers. The default for monitor is currently @samp{=b} (bold,
5038 active colors), and for bell is @samp{=ub} (underline, bold and
5042 @node Sorendition, Attrcolor, Rendition, Miscellaneous
5043 @section Sorendition
5044 @deffn Command sorendition [@var{attr} [@var{color}]]
5046 This command has been deprecated. Use @code{rendition so} instead.
5049 @node Attrcolor, Setsid, Sorendition, Miscellaneous
5051 @deffn Command attrcolor @var{attrib} [@var{attribute/color-modifier}]
5053 This command can be used to highlight attributes by changing the color of
5054 the text. If the attribute
5056 is in use, the specified attribute/color modifier is also applied. If no
5057 modifier is given, the current one is deleted. See the chapter
5058 about string escapes (@pxref{String Escapes}) for the syntax of
5059 the modifier. @code{Screen} understands two pseudo-attributes, @code{i}
5060 stands for high-intensity foreground color and @code{I} for
5061 high-intensity background color.
5066 @item attrcolor b "R"
5067 Change the color to bright red if bold text is to be printed.
5068 @item attrcolor u "-u b"
5069 Use blue text instead of underline.
5070 @item attrcolor b ".I"
5071 Use bright colors for bold text. Most terminal emulators do this
5073 @item attrcolor i "+b"
5074 Make bright colored text also bold.
5078 @node Setsid, Eval, Attrcolor, Miscellaneous
5080 @deffn Command setsid state
5082 Normally @code{screen} uses different sessions and process groups for
5083 the windows. If setsid is turned @code{off}, this is not done
5084 anymore and all windows will be in the same process group as the
5085 screen backend process. This also breaks job-control, so be careful.
5086 The default is @code{on}, of course. This command is probably useful
5087 only in rare circumstances.
5090 @node Eval, Maxwin, Setsid, Miscellaneous
5092 @deffn Command eval @var{command1} [@var{command2} ...]
5094 Parses and executes each argument as separate command.
5097 @node Maxwin, Backtick, Eval, Miscellaneous
5099 @deffn Command maxwin @var{n}
5101 Set the maximum window number screen will create. Doesn't affect
5102 already existing windows. The number may only be decreased.
5105 @node Backtick, Screen Saver, Maxwin, Miscellaneous
5107 @deffn Command backtick @var{id} @var{lifespan} @var{autorefresh} @var{command} [@var{args}]
5108 @deffnx Command backtick @var{id}
5110 Program the backtick command with the numerical id @var{id}.
5111 The output of such a command is used for substitution of the
5112 @code{%`} string escape (@pxref{String Escapes}).
5113 The specified @var{lifespan} is the number
5114 of seconds the output is considered valid. After this time, the
5115 command is run again if a corresponding string escape is encountered.
5116 The @var{autorefresh} parameter triggers an
5117 automatic refresh for caption and hardstatus strings after the
5118 specified number of seconds. Only the last line of output is used
5121 If both the @var{lifespan} and the @var{autorefresh} parameters
5122 are zero, the backtick program is expected to stay in the
5123 background and generate output once in a while.
5124 In this case, the command is executed right away and screen stores
5125 the last line of output. If a new line gets printed screen will
5126 automatically refresh the hardstatus or the captions.
5128 The second form of the command deletes the backtick command
5129 with the numerical id @var{id}.
5132 @node Screen Saver, Zmodem, Backtick, Miscellaneous
5133 @section Screen Saver
5134 @deffn Command idle [@var{timeout} [@var{cmd} @var{args}]]
5136 Sets a command that is run after the specified number of
5137 seconds inactivity is reached. This command will normally
5138 be the @code{blanker} command to create a screen blanker, but
5139 it can be any screen command. If no command is specified,
5140 only the timeout is set. A timeout of zero (ot the special
5141 timeout @code{off}) disables the timer. If no arguments are
5142 given, the current settings are displayed.
5145 @deffn Command blanker
5147 Activate the screen blanker. First the screen is cleared.
5148 If no blanker program is defined, the cursor is turned
5149 off, otherwise, the program is started and it's output is
5150 written to the screen. The screen blanker is killed with
5151 the first keypress, the read key is discarded.
5153 This command is normally used together with the @code{idle}
5157 @deffn Command blankerprg [@var{program args}]
5158 Defines a blanker program. Disables the blanker program if an
5159 empty argument is given. Shows the currently set blanker program if no
5160 arguments are given.
5164 @node Zmodem, , Screen Saver, Miscellaneous
5166 @deffn Command zmodem [off|auto|catch|pass]
5167 @deffnx Command zmodem sendcmd [string]
5168 @deffnx Command zmodem recvcmd [string]
5170 Define zmodem support for @code{screen}. @code{Screen} understands two
5171 different modes when it detects a zmodem request: @code{pass}
5172 and @code{catch}. If the mode is set to @code{pass}, screen will
5173 relay all data to the attacher until the end of the
5174 transmission is reached. In @code{catch} mode screen acts as a
5175 zmodem endpoint and starts the corresponding rz/sz commands.
5176 If the mode is set to @code{auto}, screen will use @code{catch} if
5177 the window is a tty (e.g. a serial line), otherwise it
5178 will use @code{pass}.
5180 You can define the templates screen uses in @code{catch} mode
5181 via the second and the third form.
5183 Note also that this is an experimental feature.
5186 @node String Escapes, Environment, Miscellaneous, Top
5187 @chapter String Escapes
5188 @cindex string escapes
5189 Screen provides an escape mechanism to insert information like the
5190 current time into messages or file names. The escape character
5191 is @code{%} with one exception: inside of a window's hardstatus
5192 @code{^%} (@code{^E}) is used instead.
5194 Here is the full list of supported escapes:
5198 the escape character itself
5200 either @code{am} or @code{pm}
5202 either @code{AM} or @code{PM}
5204 current time @code{HH:MM} in 24h format
5206 current time @code{HH:MM} in 12h format
5214 sets %? to true if the window has the focus
5216 hardstatus of the window
5218 hostname of the system
5220 current load of the system
5228 sets %? to true if the current region is in copy/paste mode
5236 all other users on this window
5238 all window numbers and names. With @code{-} qualifier: up to the current
5239 window; with @code{+} qualifier: starting with the window after the current
5242 all window numbers and names except the current one
5244 last two digits of the year number
5248 the part to the next @code{%?} is displayed only if a @code{%} escape
5249 inside the part expands to a non-empty string
5251 else part of @code{%?}
5253 pad the string to the display's width (like TeX's hfill). If a
5254 number is specified, pad to the percentage of the window's width.
5255 A @code{0} qualifier tells screen to treat the number as absolute position.
5256 You can specify to pad relative to the last absolute pad position
5257 by adding a @code{+} qualifier or to pad relative to the right margin
5258 by using @code{-}. The padding truncates the string if the specified
5259 position lies before the current position. Add the @code{L} qualifier
5262 same as @code{%=} but just do truncation, do not fill with spaces
5264 mark the current text position for the next truncation. When
5265 screen needs to do truncation, it tries to do it in a way that
5266 the marked position gets moved to the specified percentage of
5267 the output area. (The area starts from the last absolute pad
5268 position and ends with the position specified by the truncation
5269 operator.) The @code{L} qualifier tells screen to mark the truncated
5270 parts with @samp{...}.
5272 attribute/color modifier string terminated by the next @code{@}}
5274 Substitute with the output of a `backtick' command. The length
5275 qualifier is misused to identify one of the commands. @xref{Backtick}.
5277 The @code{c} and @code{C} escape may be qualified with a @code{0} to
5279 zero instead of space as fill character.
5281 @code{=} escapes understand
5282 a length qualifier (e.g. @code{%3n}), @code{D} and @code{M} can be
5283 prefixed with @code{L} to generate long names, @code{w} and
5284 @code{W} also show the window flags if @code{L} is given.
5286 An attribute/color modifier is is used to change the attributes or the
5287 color settings. Its format
5288 is @samp{[attribute modifier] [color description]}. The attribute modifier
5289 must be prefixed by a change type indicator if it can be confused with
5290 a color description. The following change types are known:
5293 add the specified set to the current attributes
5295 remove the set from the current attributes
5297 invert the set in the current attributes
5299 change the current attributes to the specified set
5301 The attribute set can either be specified as a hexadecimal number or
5302 a combination of the following letters:
5317 Colors are coded either as a hexadecimal number or two letters specifying
5318 the desired background and foreground color (in that order). The following
5340 leave color unchanged
5342 The capitalized versions of the letter specify bright colors. You can also
5343 use the pseudo-color @samp{i} to set just the brightness and leave the color
5346 A one digit/letter color description is treated as foreground or
5347 background color dependent on the current attributes: if reverse mode is
5348 set, the background color is changed instead of the foreground color.
5349 If you don't like this, prefix the color with a @samp{.}. If you want
5350 the same behavior for two-letter color descriptions, also prefix them
5353 As a special case, @samp{%@{-@}} restores the attributes and colors that
5354 were set before the last change was made (i.e. pops one level of the
5355 color-change stack).
5361 set color to bright green
5365 clear all attributes, write in default color on yellow background.
5366 @item %-Lw%@{= BW@}%50>%n%f* %t%@{-@}%+Lw%<
5367 The available windows centered at the current win dow and truncated to
5368 the available width. The current window is displayed white on blue.
5369 This can be used with @samp{hardstatus alwayslastline}.
5370 @item %?%F%@{.R.@}%?%3n %t%? [%h]%?
5371 The window number and title and the window's hardstatus, if one is set.
5372 Also use a red background if this is the active focus.
5373 Useful for @samp{caption string}.
5377 @node Environment, Files, String Escapes, Top
5378 @chapter Environment Variables
5383 Number of columns on the terminal (overrides termcap entry).
5386 Directory in which to look for .screenrc.
5389 Number of lines on the terminal (overrides termcap entry).
5392 Screen lock program.
5394 @item NETHACKOPTIONS
5395 Turns on @code{nethack} option.
5398 Used for locating programs to run.
5401 For customizing a terminal's @code{TERMCAP} value.
5404 Alternate socket directory.
5407 Alternate user screenrc file.
5410 Default shell program for opening windows (default @file{/bin/sh}).
5413 Alternate socket name. If @code{screen} is invoked, and the environment variable
5414 @code{STY} is set, then it creates only a window in the running @code{screen}
5415 session rather than starting a new session.
5418 Alternate system screenrc file.
5424 Terminal description.
5427 Window number of a window (at creation time).
5430 @node Files, Credits, Environment, Top
5431 @chapter Files Referenced
5435 @item .../screen-4.?.??/etc/screenrc
5436 @itemx .../screen-4.?.??/etc/etcscreenrc
5437 Examples in the @code{screen} distribution package for private and
5438 global initialization files.
5440 @item @code{$SYSSCREENRC}
5441 @itemx /local/etc/screenrc
5442 @code{screen} initialization commands
5444 @item @code{$SCREENRC}
5445 @itemx @code{$HOME}/.iscreenrc
5446 @itemx @code{$HOME}/.screenrc
5447 Read in after /local/etc/screenrc
5449 @item @code{$SCREENDIR}/S-@var{login}
5451 @item /local/screens/S-@var{login}
5452 Socket directories (default)
5454 @item /usr/tmp/screens/S-@var{login}
5455 Alternate socket directories.
5457 @item @var{socket directory}/.termcap
5458 Written by the @code{dumptermcap} command
5460 @item /usr/tmp/screens/screen-exchange or
5461 @itemx /tmp/screen-exchange
5462 @code{screen} interprocess communication buffer
5464 @item hardcopy.[0-9]
5465 Screen images created by the hardcopy command
5467 @item screenlog.[0-9]
5468 Output log files created by the log command
5470 @item /usr/lib/terminfo/?/* or
5472 Terminal capability databases
5477 @item @code{$LOCKPRG}
5478 Program for locking the terminal.
5481 @node Credits, Bugs, Files, Top
5488 Originally created by Oliver Laumann, this latest version was
5489 produced by Wayne Davison, Juergen Weigert and Michael Schroeder.
5496 Ken Beal (kbeal@@amber.ssd.csd.harris.com),
5497 Rudolf Koenig (rfkoenig@@informatik.uni-erlangen.de),
5498 Toerless Eckert (eckert@@informatik.uni-erlangen.de),
5499 Wayne Davison (davison@@borland.com),
5500 Patrick Wolfe (pat@@kai.com, kailand!pat),
5501 Bart Schaefer (schaefer@@cse.ogi.edu),
5502 Nathan Glasser (nathan@@brokaw.lcs.mit.edu),
5503 Larry W. Virden (lvirden@@cas.org),
5504 Howard Chu (hyc@@hanauma.jpl.nasa.gov),
5505 Tim MacKenzie (tym@@dibbler.cs.monash.edu.au),
5506 Markku Jarvinen (mta@@@{cc,cs,ee@}.tut.fi),
5507 Marc Boucher (marc@@CAM.ORG),
5508 Doug Siebert (dsiebert@@isca.uiowa.edu),
5509 Ken Stillson (stillson@@tsfsrv.mitre.org),
5510 Ian Frechett (frechett@@spot.Colorado.EDU),
5511 Brian Koehmstedt (bpk@@gnu.ai.mit.edu),
5512 Don Smith (djs6015@@ultb.isc.rit.edu),
5513 Frank van der Linden (vdlinden@@fwi.uva.nl),
5514 Martin Schweikert (schweik@@cpp.ob.open.de),
5515 David Vrona (dave@@sashimi.lcu.com),
5516 E. Tye McQueen (tye%spillman.UUCP@@uunet.uu.net),
5517 Matthew Green (mrg@@eterna.com.au),
5518 Christopher Williams (cgw@@pobox.com),
5519 Matt Mosley (mattm@@access.digex.net),
5520 Gregory Neil Shapiro (gshapiro@@wpi.WPI.EDU),
5521 Jason Merrill (jason@@jarthur.Claremont.EDU),
5522 Johannes Zellner (johannes@@zellner.org),
5523 Pablo Averbuj (pablo@@averbuj.com).
5530 This manual describes version @value{version} of the @code{screen}
5531 program. Its roots are a merge of a custom version 2.3PR7 by Wayne
5532 Davison and several enhancements to Oliver Laumann's version 2.0.
5533 Note that all versions numbered 2.x are copyright by Oliver Laumann.
5535 See also @xref{Availability}.
5537 @node Bugs, Installation, Credits, Top
5541 Just like any other significant piece of software, @code{screen} has a
5542 few bugs and missing features. Please send in a bug report if you have
5543 found a bug not mentioned here.
5546 * Known Bugs:: Problems we know about.
5547 * Reporting Bugs:: How to contact the maintainers.
5548 * Availability:: Where to find the latest screen version.
5551 @node Known Bugs, Reporting Bugs, , Bugs
5556 @samp{dm} (delete mode) and @samp{xs} are not handled correctly (they
5557 are ignored). @samp{xn} is treated as a magic-margin indicator.
5560 @code{screen} has no clue about double-high or double-wide characters.
5561 But this is the only area where @code{vttest} is allowed to fail.
5564 It is not possible to change the environment variable @code{$TERMCAP}
5565 when reattaching under a different terminal type.
5568 The support of terminfo based systems is very limited. Adding extra
5569 capabilities to @code{$TERMCAP} may not have any effects.
5572 @code{screen} does not make use of hardware tabs.
5575 @code{screen} must be installed setuid root on most systems
5576 in order to be able to
5577 correctly change the owner of the tty device file for each window.
5578 Special permission may also be required to write the file
5582 Entries in @file{/etc/utmp} are not removed when @code{screen} is killed
5583 with SIGKILL. This will cause some programs (like "w" or "rwho") to
5584 advertise that a user is logged on who really isn't.
5587 @code{screen} may give a strange warning when your tty has no utmp
5591 When the modem line was hung up, @code{screen} may not automatically detach
5592 (or quit) unless the device driver sends a HANGUP signal. To detach such a
5593 @code{screen} session use the -D or -d command line option.
5596 If a password is set, the command line options -d and -D still detach a
5597 session without asking.
5600 Both @code{breaktype} and @code{defbreaktype} change the break generating
5601 method used by all terminal devices. The first should change a window
5602 specific setting, where the latter should change only the default for new
5606 When attaching to a multiuser session, the user's @file{.screenrc} file is not
5607 sourced. Each users personal settings have to be included in the
5608 @file{.screenrc} file from which the session is booted, or have to be
5612 A weird imagination is most useful to gain full advantage of all the
5616 @node Reporting Bugs, Availability, Known Bugs, Bugs
5617 @section Reporting Bugs
5620 If you find a bug in @code{Screen}, please send electronic mail to
5621 @w{@samp{screen@@uni-erlangen.de}}, and also to
5622 @w{@samp{bug-gnu-utils@@prep.ai.mit.edu}}. Include the version number
5623 of @code{Screen} which you are using. Also include in your message the
5624 hardware and operating system, the compiler used to compile, a
5625 description of the bug behavior, and the conditions that triggered the
5626 bug. Please recompile @code{screen} with the @samp{-DDEBUG} options
5627 enabled, reproduce the bug, and have a look at the debug output written to
5628 the directory @file{/tmp/debug}. If necessary quote suspect passages from the
5629 debug output and show the contents of your @file{config.h} if it matters.
5631 @node Availability, , Reporting Bugs, Bugs
5632 @section Availability
5633 @cindex availability
5635 @code{Screen} is available under the @code{GNU} copyleft.
5637 The latest official release of @code{screen} available via anonymous
5638 ftp from @samp{prep.ai.mit.edu}, @samp{nic.funet.fi} or any other
5639 @code{GNU} distribution site. The home site of
5640 @code{screen} is @samp{ftp.uni-erlangen.de
5641 (131.188.3.71)}, in the directory @file{pub/utilities/screen}.
5642 The subdirectory @samp{private} contains the latest beta testing release.
5643 If you want to help, send a note to screen@@uni-erlangen.de.
5645 @node Installation, Concept Index, Bugs, Top
5646 @chapter Installation
5647 @cindex installation
5649 Since @code{screen} uses pseudo-ttys, the select system call, and
5650 UNIX-domain sockets/named pipes, it will not run under a system that
5651 does not include these features of 4.2 and 4.3 BSD UNIX.
5654 * Socket Directory:: Where screen stores its handle.
5655 * Compiling Screen::
5658 @node Socket Directory,
5659 @section Socket Directory
5660 @cindex socket directory
5662 The socket directory defaults either to @file{$HOME/.screen} or simply to
5663 @file{/tmp/screens} or preferably to @file{/usr/local/screens} chosen at
5664 compile-time. If @code{screen} is installed
5665 setuid root, then the administrator should compile screen with an
5666 adequate (not NFS mounted) @code{SOCKDIR}. If @code{screen} is not
5667 running setuid-root, the user can specify any mode 700 directory in the
5668 environment variable @code{$SCREENDIR}.
5670 @node Compiling Screen, , Socket Directory, Installation
5671 @section Compiling Screen
5672 @cindex compiling screen
5674 To compile and install screen:
5676 The @code{screen} package comes with a @code{GNU Autoconf} configuration
5677 script. Before you compile the package run
5679 @center @code{sh ./configure}
5681 This will create a @file{config.h} and @file{Makefile} for your machine.
5682 If @code{configure} fails for some reason, then look at the examples and
5683 comments found in the @file{Makefile.in} and @file{config.h.in} templates.
5684 Rename @file{config.status} to @file{config.status.@var{machine}} when
5685 you want to keep configuration data for multiple architectures. Running
5686 @code{sh ./config.status.@var{machine}} recreates your configuration
5687 significantly faster than rerunning @code{configure}.
5689 Read through the "User Configuration" section of @file{config.h}, and verify
5690 that it suits your needs.
5691 A comment near the top of this section explains why it's best to
5692 install screen setuid to root.
5693 Check for the place for the global @file{screenrc}-file and for the socket
5696 Check the compiler used in @file{Makefile}, the prefix path where to install
5697 @code{screen}. Then run
5701 If @code{make} fails to produce one of the files @file{term.h}, @file{comm.h}
5702 or @file{tty.c}, then use @code{@var{filename.x}.dist} instead.
5703 For additional information about installation of @code{screen} refer to the
5704 file @file{INSTALLATION}, coming with this package.
5706 @node Concept Index, Command Index, Installation, Top
5707 @unnumbered Concept Index
5711 @node Command Index, Keystroke Index, Concept Index, Top
5712 @unnumbered Command Index
5714 This is a list of all the commands supported by @code{screen}.
5718 @node Keystroke Index, , Command Index, Top
5719 @unnumbered Keystroke Index
5721 This is a list of the default key bindings.
5723 The leading escape character (@pxref{Command Character}) has been omitted
5724 from the key sequences, since it is the same for all bindings.