Misc updates to the man and info pages.
[screen-lua.git] / src / doc / screen.texinfo
blob08ca259d4b9b11f94ba8ad5478c6665db85d211e
1 \input texinfo @c -*-texinfo-*-
2 @c %**start of header
3 @c vi:set wm=5
4 @setfilename screen.info
5 @settitle Screen User's Manual
6 @dircategory General Commands
7 @finalout
8 @setchapternewpage odd
9 @c %**end of header
10 @set version 4.1.0
12 @direntry
13 * Screen: (screen).             Full-screen window manager.
14 @end direntry
16 @c For examples, use a literal escape in info.
17 @ifinfo
18 @set esc ^[
19 @end ifinfo
20 @iftex
21 @set esc <ESC>
22 @end iftex
24 @ifinfo
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.
33 @ignore
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).
39 @end ignore
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
48 by the Foundation.
49 @end ifinfo
51 @titlepage
52 @title Screen
53 @subtitle The virtual terminal manager
54 @subtitle for Version @value{version}
55 @subtitle Aug 2003
57 @page
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
73 by the Foundation.
74 @end titlepage
76 @shortcontents
77 @contents
79 @node Top, Overview, (dir), (dir)
81 @ifinfo
82 @top Screen
83 This file documents the @code{Screen} virtual terminal manager, version
84 @value{version}.
85 @end ifinfo
87 @menu
88 * Overview::                    Preliminary information.
89 * Getting Started::             An introduction to @code{screen}.
90 * Invoking Screen::             Command line options for @code{screen}.
91 * Customization::               The @file{.screenrc} file.
92 * Commands::                    List all of the commands.
93 * New Window::                  Running a program in a new window.
94 * Selecting::                   Selecting a window to display.
95 * Session Management::          Suspend/detach, grant access, connect sessions.
96 * Regions::                     Split-screen commands.
97 * Window Settings::             Titles, logging, etc.
98 * Virtual Terminal::            Controlling the @code{screen} VT100 emulation.
99 * Copy and Paste::              Exchanging text between windows and sessions.
100 * Subprocess Execution::        I/O filtering with @code{exec}.
101 * Key Binding::                 Binding commands to keys.
102 * Flow Control::                Trap or pass flow control characters.
103 * Termcap::                     Tweaking your terminal's termcap entry.
104 * Message Line::                The @code{screen} message line.
105 * Logging::                     Keeping a record of your session.
106 * Startup::                     Functions only useful at @code{screen} startup.
107 * Miscellaneous::               Various other commands.
108 * String Escapes::              Inserting current information into strings
109 * Environment::                 Environment variables used by @code{screen}.
110 * Files::                       Files used by @code{screen}.
111 * Credits::                     Who's who of @code{screen}.
112 * Bugs::                        What to do if you find a bug.
113 * Installation::                Getting @code{screen} running on your system.
114 * Concept Index::               Index of concepts.
115 * Command Index::               Index of all @code{screen} commands.
116 * Keystroke Index::             Index of default key bindings.
117 @end menu
119 @node Overview, Getting Started, Top, Top
120 @chapter Overview
121 @cindex overview
123 Screen is a full-screen window manager that multiplexes a physical
124 terminal between several processes, typically interactive shells.  Each
125 virtual terminal provides the functions of the DEC VT100 terminal and,
126 in addition, several control functions from the ISO 6429 (ECMA 48, ANSI X3.64)
127 and ISO 2022 standards (e.g. insert/delete line and support for multiple
128 character sets).  There is a scrollback history buffer for each virtual
129 terminal and a copy-and-paste mechanism that allows the user to move
130 text regions between windows.
132 When @code{screen} is called, it creates a single window with a shell in
133 it (or the specified command) and then gets out of your way so that you
134 can use the program as you normally would.  Then, at any time, you can
135 create new (full-screen) windows with other programs in them (including
136 more shells), kill the current window, view a list of the active
137 windows, turn output logging on and off, copy text between windows, view
138 the scrollback history, switch between windows, etc.  All windows run
139 their programs completely independent of each other.  Programs continue
140 to run when their window is currently not visible and even when the
141 whole screen session is detached from the user's terminal.
143 When a program terminates, @code{screen} (per default) kills the window
144 that contained it.  If this window was in the foreground, the display
145 switches to the previously displayed window; if none are left,
146 @code{screen} exits.
148 Everything you type is sent to the program running in the current
149 window.  The only exception to this is the one keystroke that is used to
150 initiate a command to the window manager.  By default, each command
151 begins with a control-a (abbreviated @kbd{C-a} from now on), and is
152 followed by one other keystroke.  The command character (@pxref{Command
153 Character}) and all the key bindings (@pxref{Key Binding}) can be fully
154 customized to be anything you like, though they are always two
155 characters in length.
157 @code{Screen} does not understand the prefix @kbd{C-} to mean control.
158 Please use the caret notation (@kbd{^A} instead of @kbd{C-a}) as arguments
159 to e.g. the @code{escape} command or the @code{-e} option. @code{Screen}
160 will also print out control characters in caret notation.
162 The standard way to create a new window is to type @kbd{C-a c}.  This
163 creates a new window running a shell and switches to that window
164 immediately, regardless of the state of the process running in the
165 current window.  Similarly, you can create a new window with a custom
166 command in it by first binding the command to a keystroke (in your
167 @file{.screenrc} file or at the @kbd{C-a :} command line) and then using it 
168 just like the @kbd{C-a c} command.  In addition, new windows can be created by 
169 running a command like:
171 @example
172 screen emacs prog.c
173 @end example
175 @noindent
176 from a shell prompt within a previously created window.  This will not
177 run another copy of @code{screen}, but will instead supply the command
178 name and its arguments to the window manager (specified in the $STY environment
179 variable) who will use it to create the new window.  The above example would 
180 start the @code{emacs} editor (editing @file{prog.c}) and switch to its window.
181 - Note that you cannot transport environment variables from
182 the invoking shell to the application (emacs in this case), because it is
183 forked from the parent screen process, not from the invoking shell.
185 If @file{/etc/utmp} is writable by @code{screen}, an appropriate record
186 will be written to this file for each window, and removed when the
187 window is closed.  This is useful for working with @code{talk},
188 @code{script}, @code{shutdown}, @code{rsend}, @code{sccs} and other
189 similar programs that use the utmp file to determine who you are. As
190 long as @code{screen} is active on your terminal, the terminal's own
191 record is removed from the utmp file.  @xref{Login}.
193 @node Getting Started, Invoking Screen, Overview, Top
194 @chapter Getting Started
195 @cindex introduction
197 Before you begin to use @code{screen} you'll need to make sure you have
198 correctly selected your terminal type, just as you would for any other
199 termcap/terminfo program.  (You can do this by using @code{tset},
200 @code{qterm}, or just @code{set term=mytermtype}, for example.)
202 If you're impatient and want to get started without doing a lot more
203 reading, you should remember this one command: @kbd{C-a ?} (@pxref{Key
204 Binding}).  Typing these two characters will display a list of the
205 available @code{screen} commands and their bindings. Each keystroke is
206 discussed in the section on keystrokes (@pxref{Default Key Bindings}).
207 Another section (@pxref{Customization}) deals with the contents of your
208 @file{.screenrc}.
210 If your terminal is a ``true'' auto-margin terminal (it doesn't allow
211 the last position on the screen to be updated without scrolling the
212 screen) consider using a version of your terminal's termcap that has
213 automatic margins turned @emph{off}.  This will ensure an accurate
214 and optimal update of the screen in all circumstances.  Most terminals
215 nowadays have ``magic'' margins (automatic margins plus usable last
216 column).  This is the VT100 style type and perfectly suited for
217 @code{screen}.
218 If all you've got is a ``true'' auto-margin terminal @code{screen}
219 will be content to use it, but updating a character put into the last
220 position on the screen may not be possible until the screen scrolls or
221 the character is moved into a safe position in some other way. This
222 delay can be shortened by using a terminal with insert-character
223 capability.
225 @xref{Special Capabilities}, for more information about telling
226 @code{screen} what kind of terminal you have.
228 @node Invoking Screen, Customization, Getting Started, Top
229 @chapter Invoking @code{Screen}
230 @cindex invoking
231 @cindex options
232 @cindex command line options
234 Screen has the following command-line options:
236 @table @samp
237 @item -a
238 Include @emph{all} capabilities (with some minor exceptions) in each
239 window's termcap, even if @code{screen} must redraw parts of the display
240 in order to implement a function.
242 @item -A
243 Adapt the sizes of all windows to the size of the display.  By default,
244 @code{screen} may try to restore its old window sizes when attaching to
245 resizable terminals (those with @samp{WS} in their descriptions, e.g.
246 @code{suncmd} or some varieties of @code{xterm}).
248 @item -c @var{file}
249 Use @var{file} as the user's configuration file instead of the default
250 of @file{$HOME/.screenrc}.
252 @item -d [@var{pid.sessionname}]
253 @itemx -D [@var{pid.sessionname}]
254 Do not start @code{screen}, but instead detach a @code{screen} session
255 running elsewhere (@pxref{Detach}).  @samp{-d} has the same effect as
256 typing @kbd{C-a d} from the controlling terminal for the session.
257 @samp{-D} is the equivalent to the power detach key.  If no session can
258 be detached, this option is ignored.  In combination with the 
259 @code{-r}/@code{-R} option more powerful effects can be achieved:
261 @table @code
262 @item -d -r
263 Reattach a session and if necessary detach it first.
264 @item -d -R   
265 Reattach a session and if necessary detach  or  even create it first.
266 @item -d -RR  
267 Reattach a session and if necessary detach or create it.
268 Use the first session if more than one session is available.
269 @item -D -r   
270 Reattach a session. If necessary detach  and  logout remotely first.
271 @item -D -R   
272 Attach here and now. In detail this means: If a session  is running, 
273 then reattach. If necessary detach and logout remotely first.  If it
274 was not running create it and notify the user.
275 This is the author's favorite.
276 @item -D -RR  
277 Attach here and now. Whatever that  means, just do it.
278 @end table
280 @emph{Note}: It is a good idea to check the status of your sessions
281 with @code{screen -list} before using this option.
283 @item -e @var{xy}
284 Set the command character to @var{x}, and the character generating a
285 literal command character (when typed after the command character) to
286 @var{y}.  The defaults are @kbd{C-a} and @kbd{a}, which can be specified
287 as @samp{-e^Aa}.  When creating a @code{screen} session, this option
288 sets the default command character. In a multiuser session all users
289 added will start off with this command character. But when attaching
290 to an already running session, this option only changes the command
291 character of the attaching user.
292 This option is equivalent to the commands @code{defescape} or 
293 @code{escape} respectively.  (@pxref{Command Character}).
295 @item -f
296 @itemx -fn
297 @itemx -fa
298 Set flow-control to on, off, or automatic switching mode, respectively.
299 This option is equivalent to the @code{defflow} command (@pxref{Flow
300 Control}).
302 @item -h @var{num}
303 Set the history scrollback buffer to be @var{num} lines high.
304 Equivalent to the @code{defscrollback} command (@pxref{Copy}).
306 @item -i
307 Cause the interrupt key (usually @kbd{C-c}) to interrupt the display
308 immediately when flow control is on.  This option is equivalent to the
309 @code{interrupt} argument to the @code{defflow} command (@pxref{Flow
310 Control}). Its use is discouraged.
312 @item -l
313 @itemx -ln
314 Turn login mode on or off (for @file{/etc/utmp} updating).  This option
315 is equivalent to the @code{deflogin} command (@pxref{Login}).
317 @item -ls [@var{match}]
318 @itemx -list [@var{match}]
319 Do not start @code{screen}, but instead print a list of session
320 identification strings (usually of the form @var{pid.tty.host};
321 @pxref{Session Name}).  Sessions marked @samp{detached} can be resumed
322 with @code{screen -r}.  Those marked @samp{attached} are running and
323 have a controlling terminal.  If the session runs in multiuser mode,
324 it is marked @samp{multi}.  Sessions marked as @samp{unreachable} either
325 live on a different host or are dead. 
326 An unreachable session is considered dead, when its name matches either the
327 name of the local host, or the specified parameter, if any.
328 See the @code{-r} flag for a description how to construct matches.
329 Sessions marked as @samp{dead} should be thoroughly checked and removed.  
330 Ask your system administrator if you are not sure.
331 Remove sessions with the @samp{-wipe} option.
333 @item -L
334 Tell @code{screen} to turn on automatic output logging for the
335 windows.
337 @item -m
338 Tell @code{screen} to ignore the @code{$STY} environment variable.  When
339 this option is used, a new session will always be created, regardless of
340 whether @code{screen} is being called from within another @code{screen}
341 session or not. This flag has a special meaning in connection
342 with the @samp{-d} option:
343 @table @code
344 @item -d -m
345 Start @code{screen} in @emph{detached} mode. This creates a new
346 session but doesn't attach to it. This is useful for system startup
347 scripts.
348 @item -D -m
349 This also starts @code{screen} in @emph{detached} mode, but doesn't fork
350 a new process. The command exits if the session terminates.
351 @end table
353 @item -O
354 Select a more optimal output mode for your terminal rather than true VT100
355 emulation (only affects auto-margin  terminals  without @samp{LP}). This
356 can also be set in your @file{.screenrc} by specifying @samp{OP} in the 
357 @code{termcap} command.
359 @item -p @var{name_or_number}|-|=|+
360 Preselect a window. This is useful when you want to reattach to a
361 specific window or you want to send a command via the @samp{-X}
362 option to a specific window. As with screen's select command, @samp{-}
363 selects the blank window. As a special case for reattach, @samp{=}
364 brings up the windowlist on the blank window, while a @samp{+} will
365 create new window. The command will not be executed if the specified
366 window could not be found.
368 @item -q
369 Suppress printing of error messages. In combination with @samp{-ls} the exit 
370 value is set as follows: 9 indicates a directory without sessions. 10 
371 indicates a directory with running but not attachable sessions. 11 (or more) 
372 indicates 1 (or more) usable sessions.
373 In combination with @samp{-r} the exit value is as follows: 10 indicates that 
374 there is no session to resume. 12 (or more) indicates that there are 2 (or 
375 more) sessions to resume and you should specify which one to choose. 
376 In all other cases @samp{-q} has no effect.
378 @item -Q
379 Some commands now can be queried from a remote session using this
380 flag, e.g. 'screen -Q windows'. The commands will send the
381 response to the stdout of the querying process. If there was an
382 error in the command, then the querying process will exit with
383 a non-zero status.
385 The commands that can be queried now are:
386  @code{echo}
387  @code{info}
388  @code{lastmsg}
389  @code{number}
390  @code{select}
391  @code{time}
392  @code{title}
393  @code{windows}
395 @item -r [@var{pid.sessionname}]
396 @itemx -r @var{sessionowner}/[@var{pid.sessionname}]
397 Resume a detached @code{screen} session.  No other options (except
398 combinations with @samp{-d} or @samp{-D}) may be specified, though 
399 the session name
400 (@pxref{Session Name}) may be needed to distinguish between multiple
401 detached @code{screen} sessions.
402 The second form is used to connect to another user's screen session which
403 runs in multiuser mode. This indicates that screen should look for
404 sessions in another user's directory. This requires setuid-root.
406 @item -R
407 Resume the first appropriate detached @code{screen} session.  If
408 successful, all other command-line options are ignored.  If no detached
409 session exists, start a new session using the specified options, just as
410 if @samp{-R} had not been specified.  This option is set by default if
411 screen is run as a login-shell (actually screen uses @samp{-xRR} in
412 that case).
413 For combinations with the 
414 @samp{-D}/@samp{-d} option see there.
416 @item -s @var{program}
417 Set the default shell to be @var{program}.  By default, @code{screen}
418 uses the value of the environment variable @code{$SHELL}, or
419 @file{/bin/sh} if it is not defined.  This option is equivalent to the
420 @code{shell} command (@pxref{Shell}).
422 @item -S @var{sessionname}
423 Set the name of the new session to @var{sessionname}.  This option can
424 be used to specify a meaningful name for the session in place of the
425 default @var{tty.host} suffix.  This name identifies the session for the
426 @code{screen -list} and @code{screen -r} commands.  This option is
427 equivalent to the @code{sessionname} command (@pxref{Session Name}).
429 @item -t @var{name}
430 Set the title (name) for the default shell or specified program.
431 This option is equivalent to the @code{shelltitle} command
432 (@pxref{Shell}).
434 @item -T @var{term}
435 Set the $TERM enviroment varible using the spcified @emph{term} as 
436 opposed to the defualt setting of @code{screen}.
438 @item -U
439 Run screen in UTF-8 mode. This option tells screen that your terminal
440 sends and understands UTF-8 encoded characters. It also sets the default
441 encoding for new windows to @samp{utf8}.
443 @item -v
444 Print the version number.
446 @item -wipe [@var{match}]
447 List available screens like @code{screen -ls}, but remove destroyed
448 sessions instead of marking them as @samp{dead}. 
449 An unreachable session is considered dead, when its name matches either 
450 the name of the local host, or the explicitly given parameter, if any.
451 See the @code{-r} flag for a description how to construct matches.
453 @item -x
454 Attach to a session which is already attached elsewhere (multi-display
455 mode). 
456 @code{Screen} refuses to attach from within itself. 
457 But when cascading multiple screens, loops are not detected; take care.
460 @item -X
461 Send the specified command to a running screen session. You can use
462 the @code{-d} or @code{-r} option to tell screen to look only for 
463 attached or detached screen sessions. Note that this command doesn't
464 work if the session is password protected.
466 @end table
468 @node Customization, Commands, Invoking Screen, Top
469 @chapter Customizing @code{Screen}
470 @cindex customization
472 You can modify the default settings for @code{screen} to fit your tastes
473 either through a personal @file{.screenrc} file which contains commands
474 to be executed at startup, or on the fly using the @code{colon} command.
476 @menu
477 * Startup Files::               The @file{.screenrc} file.
478 * Source::                      Read commands from a file.
479 * Colon::                       Entering customization commands interactively.
480 @end menu
482 @node Startup Files, Source,  , Customization
483 @section The @file{.screenrc} file
484 @cindex .screenrc
485 @cindex screenrc
486 When @code{screen} is invoked, it executes initialization commands from
487 the files @file{.screenrc} in the user's home directory and
488 @file{/usr/local/etc/screenrc}.  These defaults can be overridden in the 
489 following ways:
490 For the global screenrc file @code{screen} searches for the environment
491 variable @code{$SYSSCREENRC} (this override feature may be disabled at
492 compile-time).  The user specific screenrc file is
493 searched for in @code{$SCREENRC}, then 
494 @file{@code{$HOME}/.screenrc}.  The command line option @samp{-c}
495 specifies which file to use (@pxref{Invoking Screen}.  Commands in these
496 files are used to set options, bind commands to keys, and to
497 automatically establish one or more windows at the beginning of
498 your @code{screen} session.  Commands are listed one per line, with
499 empty lines being ignored.  A command's arguments are separated by tabs
500 or spaces, and may be surrounded by single or double quotes.  A @samp{#}
501 turns the rest of the line into a comment, except in quotes.
502 Unintelligible lines are warned about and ignored.  Commands may contain
503 references to environment variables.  The syntax is the shell-like
504 @code{$VAR} or @code{$@{VAR@}}.  Note that this causes incompatibility
505 with previous @code{screen} versions, as now the '$'-character has to be
506 protected with '\' if no variable substitution is intended. A string in 
507 single-quotes is also protected from variable substitution.
509 Two configuration files are shipped as examples with your screen
510 distribution: @file{etc/screenrc} and @file{etc/etcscreenrc}. They
511 contain a number of useful examples for various commands.
513 @node Source, Colon, Startup Files, Customization
514 @section Source
515 @deffn Command source file
516 (none)@*
517 Read and execute commands from file @var{file}. Source  commands
518 may be nested to a maximum recursion level of ten. If @var{file}
519 is not an absolute path and  screen  is already processing  a
520 source command, the parent directory of the running source
521 command file is used to search for the new command file  before
522 screen's current directory.
524 Note  that termcap/terminfo/termcapinfo commands only work
525 at startup and reattach time, so they must be reached  via
526 the default screenrc files to have an effect.
527 @end deffn
529 @node Colon,  , Source, Customization
530 @section Colon
531 Customization can also be done online, with this command:
533 @kindex :
534 @deffn Command colon
535 (@kbd{C-a :})@* 
536 Allows you to enter @file{.screenrc} command lines.  Useful for
537 on-the-fly modification of key bindings, specific window creation and
538 changing settings.  Note that the @code{set} keyword no longer exists,
539 as of version 3.3.  Change default settings with commands starting with
540 @samp{def}.  You might think of this as the @code{ex} command mode of
541 @code{screen}, with @code{copy} as its @code{vi} command mode
542 (@pxref{Copy and Paste}).
543 @end deffn
545 @node Commands, New Window, Customization, Top
546 @chapter Commands
548 A command in @code{screen} can either be bound to a key, invoked from a
549 screenrc file, or called from the @code{colon} prompt
550 (@pxref{Customization}).  As of version 3.3, all commands can be bound
551 to keys, although some may be less useful than others.
552 For a number of real life working examples of the most important
553 commands see the files @file{etc/screenrc} and @file{etc/etcscreenrc}
554 of your screen distribution.
556 In this manual, a command definition looks like this:
558 @table @asis
559 @item -- Command: command [-n] ARG1 [ARG2] @dots{}
560 (@var{keybindings})@*
561 This command does something, but I can't remember what.
562 @end table
564 An argument in square brackets (@samp{[]}) is optional.  Many commands
565 take an argument of @samp{on} or @samp{off}, which is indicated as
566 @var{state} in the definition.
568 @menu
569 * Default Key Bindings::        @code{screen} keyboard commands.
570 * Command Summary::             List of all commands.
571 @end menu
573 @node Default Key Bindings, Command Summary,  , Commands
574 @section Default Key Bindings
576 As mentioned previously, each keyboard command consists of a
577 @kbd{C-a} followed by one other character.  For your convenience, all
578 commands that are bound to lower-case letters are also bound to their
579 control character counterparts (with the exception of @kbd{C-a a}; see
580 below).  Thus, both @kbd{C-a c} and @kbd{C-a C-c} can be used to create
581 a window.
583 The following table shows the default key bindings:
585 @table @asis
586 @item @kbd{C-a '}
587 (select)@*
588 Prompt for a window identifier and switch.
589 @xref{Selecting}.
591 @item @kbd{C-a "}
592 (windowlist -b)@*
593 Present a list of all windows for selection.
594 @xref{Selecting}.
596 @item @kbd{C-a 0@dots{}9, -}
597 (select 0@dots{}select 9, select -)@*
598 Switch to window number 0@dots{}9, or the blank window.
599 @xref{Selecting}.
601 @item @kbd{C-a @key{Tab}}
602 (focus)@*
603 Switch the input focus to the next region.  @xref{Regions}.
605 @item @kbd{C-a C-a}
606 (other)@*
607 Toggle to the window displayed previously.  If this window does no 
608 longer exist, @code{other} has the same effect as @code{next}.
609 @xref{Selecting}.
611 @item @kbd{C-a a}
612 (meta)@*
613 Send the command character (C-a) to window. See @code{escape} command.
614 @xref{Command Character}. 
616 @item @kbd{C-a A}
617 (title)@*
618 Allow the user to enter a title for the current window.
619 @xref{Naming Windows}.
621 @item @kbd{C-a b}
622 @itemx @kbd{C-a C-b}
623 (break)@*
624 Send a break to the tty.
625 @xref{Break}.
627 @item @kbd{C-a B}
628 (pow_break)@*
629 Close and reopen the tty-line.
630 @xref{Break}.
632 @item @kbd{C-a c}
633 @itemx @kbd{C-a C-c}
634 (screen)@*
635 Create a new window with a shell and switch to that window.
636 @xref{Screen Command}.
638 @item @kbd{C-a C}
639 (clear)@*
640 Clear the screen.  @xref{Clear}.
642 @item @kbd{C-a d}
643 @itemx @kbd{C-a C-d}
644 (detach)@*
645 Detach @code{screen} from this terminal.  @xref{Detach}.
647 @item @kbd{C-a D D}
648 (pow_detach)@*
649 Detach and logout.  @xref{Power Detach}.
651 @item @kbd{C-a f}
652 @itemx @kbd{C-a C-f}
653 (flow)@*
654 Cycle flow among @samp{on}, @samp{off} or @samp{auto}.  @xref{Flow}.
656 @item @kbd{C-a F}
657 (fit)@*
658 Resize the window to the current region size.  @xref{Fit}.
660 @item @kbd{C-a C-g}
661 (vbell)@*
662 Toggle visual bell mode.  @xref{Bell}.
664 @item @kbd{C-a h}
665 (hardcopy)@*
666 Write a hardcopy of the current window to the file ``hardcopy.@var{n}''.
667 @xref{Hardcopy}.
669 @item @kbd{C-a H}
670 (log)@* 
671 Toggle logging of the current window to the file ``screenlog.@var{n}''.
672 @xref{Log}.
674 @item @kbd{C-a i}
675 @itemx @kbd{C-a C-i}
676 (info)@*
677 Show info about the current window.  @xref{Info}.
679 @item @kbd{C-a k}
680 @itemx @kbd{C-a C-k}
681 (kill)@*
682 Destroy the current window.  @xref{Kill}.
684 @item @kbd{C-a l}
685 @itemx @kbd{C-a C-l}
686 (redisplay)@*
687 Fully refresh the current window.  @xref{Redisplay}.
689 @item @kbd{C-a L}
690 (login)@*
691 Toggle the current window's login state.  @xref{Login}.
693 @item @kbd{C-a m}
694 @itemx @kbd{C-a C-m}
695 (lastmsg)@*
696 Repeat the last message displayed in the message line.
697 @xref{Last Message}.
699 @item @kbd{C-a M}
700 (monitor)
701 Toggle monitoring of the current window.  @xref{Monitor}.
703 @item @kbd{C-a @key{SPC}}
704 @itemx @kbd{C-a n}
705 @itemx @kbd{C-a C-n}
706 (next)@*
707 Switch to the next window.  @xref{Selecting}.
709 @item @kbd{C-a N}
710 (number)@*
711 Show the number (and title) of the current window.  @xref{Number}.
713 @item @kbd{C-a p}
714 @itemx @kbd{C-a C-p}
715 @itemx @kbd{C-a C-h}
716 @itemx @kbd{C-a @key{BackSpace}}
717 (prev)@*
718 Switch to the previous window (opposite of @kbd{C-a n}).
719 @xref{Selecting}.
721 @item @kbd{C-a q}
722 @itemx @kbd{C-a C-q}
723 (xon)@*
724 Send a ^Q (ASCII XON) to the current window.  @xref{XON/XOFF}.
726 @item @kbd{C-a Q}
727 (only)@*
728 Delete all regions but the current one.  @xref{Regions}.
730 @item @kbd{C-a r}
731 @itemx @kbd{C-a C-r}
732 (wrap)@*
733 Toggle the current window's line-wrap setting (turn the current window's
734 automatic margins on or off).  @xref{Wrap}.
736 @item @kbd{C-a s}
737 @itemx @kbd{C-a C-s}
738 (xoff)@*
739 Send a ^S (ASCII XOFF) to the current window.  @xref{XON/XOFF}.
741 @item @kbd{C-a S}
742 (split)@*
743 Split the current region horizontally into two new ones.  @xref{Regions}.
745 @item @kbd{C-a t}
746 @itemx @kbd{C-a C-t}
747 (time)@*
748 Show the load average and xref.  @xref{Time}.
750 @item @kbd{C-a v}
751 (version)@*
752 Display the version and compilation date.  @xref{Version}.
754 @item @kbd{C-a C-v}
755 (digraph)@*
756 Enter digraph.  @xref{Digraph}.
758 @item @kbd{C-a w}
759 @itemx @kbd{C-a C-w}
760 (windows)@*
761 Show a list of active windows.  @xref{Windows}.
763 @item @kbd{C-a W}
764 (width)@*
765 Toggle between 80 and 132 columns.  @xref{Window Size}.
767 @item @kbd{C-a x}
768 @itemx @kbd{C-a C-x}
769 (lockscreen)@*
770 Lock your terminal.  @xref{Lock}.
772 @item @kbd{C-a X}
773 (remove)@*
774 Kill the current region.  @xref{Regions}.
776 @item @kbd{C-a z}
777 @itemx @kbd{C-a C-z}
778 (suspend)@*
779 Suspend @code{screen}.  @xref{Suspend}.
781 @item @kbd{C-a Z}
782 (reset)@*
783 Reset the virtual terminal to its ``power-on'' values.  
784 @xref{Reset}.
786 @item @kbd{C-a .}
787 (dumptermcap)@*
788 Write out a @file{.termcap} file.  @xref{Dump Termcap}.
790 @item @kbd{C-a ?}
791 (help)@*
792 Show key bindings.  @xref{Help}.
794 @item @kbd{C-a C-\}
795 (quit)@*
796 Kill all windows and terminate @code{screen}.  @xref{Quit}.
798 @item @kbd{C-a :}
799 (colon)@*
800 Enter a command line.  @xref{Colon}.
802 @item @kbd{C-a [}
803 @itemx @kbd{C-a C-[}
804 @itemx @kbd{C-a @key{ESC}}
805 (copy)@*
806 Enter copy/scrollback mode.  @xref{Copy}.
808 @item @kbd{C-a ]}
809 @itemx @kbd{C-a C-]}
810 (paste .)@*
811 Write the contents of the paste buffer to the stdin queue of the
812 current window.  @xref{Paste}.
814 @item @kbd{C-a @{}
815 @itemx @kbd{C-a @}}
816 (history)@*
817 Copy and paste a previous (command) line.  @xref{History}.
819 @item @kbd{C-a >}
820 (writebuf)@*
821 Write the paste buffer out to the screen-exchange file.
822 @xref{Screen Exchange}.
824 @item @kbd{C-a <}
825 (readbuf)@*
826 Read the screen-exchange file into the paste buffer.
827 @xref{Screen Exchange}.
829 @item @kbd{C-a =}
830 (removebuf)@*
831 Delete the screen-exchange file.  @xref{Screen Exchange}.
833 @item @kbd{C-a _}
834 (silence)@*
835 Start/stop monitoring the current window for inactivity. @xref{Monitor}.
837 @item @kbd{C-a |}
838 (split -v)@*
839 Split the current region vertically into two new ones.  @xref{Regions}.
841 @item @kbd{C-a ,}
842 (license)@*
843 Show the copyright page.  @xref{License}.
845 @item @kbd{C-a *}
846 (displays)@*
847 Show the listing of attached displays.  @xref{Displays}.
848 @end table
850 @node Command Summary,  , Default Key Bindings, Commands
851 @section Command Summary
852 @cindex command summary 
854 @table @code
855 @item acladd @var{usernames}
856 Allow other users in this session.  @xref{Multiuser Session}.
857 @item aclchg @var{usernames permbits list}
858 Change a user's permissions.  @xref{Multiuser Session}.
859 @item acldel @var{username}
860 Disallow other user in this session.  @xref{Multiuser Session}.
861 @item aclgrp @var{usrname} [@var{groupname}]
862 Inherit permissions granted to a group leader. @xref{Multiuser Session}.
863 @item aclumask [@var{users}]+/-@var{bits} ...
864 Predefine access to new windows. @xref{Umask}.
865 @item activity @var{message}
866 Set the activity notification message.  @xref{Monitor}.
867 @item addacl @var{usernames}
868 Synonym to @code{acladd}.  @xref{Multiuser Session}.
869 @item allpartial @var{state}
870 Set all windows to partial refresh.  @xref{Redisplay}.
871 @item altscreen @var{state}
872 Enables support for the "alternate screen" terminal capability.  @xref{Redisplay}.
873 @item at [@var{ident}][@kbd{#}@var{|}@kbd{*}@var{|}@kbd{%}] @var{command} [@var{args}]
874 Execute a command at other displays or windows.  @xref{At}.
875 @item attrcolor @var{attrib} [@var{attribute/color-modifier}]
876 Map attributes to colors.  @xref{Attrcolor}.
877 @item autodetach @var{state}
878 Automatically detach the session on SIGHUP.  @xref{Detach}.
879 @item autonuke @var{state}
880 Enable a clear screen to discard unwritten output.  @xref{Autonuke}.
881 @item backtick @var{id} @var{lifespan} @var{autorefresh} @var{command} [@var{args}]
882 Define a command for the backtick string escape.  @xref{Backtick}.
883 @item bce [@var{state}]
884 Change background color erase.  @xref{Character Processing}.
885 @item bell_msg [@var{message}]
886 Set the bell notification message.  @xref{Bell}.
887 @item bind [-c @var{class}] @var{key} [@var{command} [@var{args}]]
888 Bind a command to a key.  @xref{Bind}.
889 @item bindkey [@var{opts}] [@var{string} [@var{cmd args}]]
890 Bind a string to a series of keystrokes. @xref{Bindkey}.
891 @item blanker
892 Blank the screen.  @xref{Screen Saver}.
893 @item blankerprg
894 Define a blanker program.  @xref{Screen Saver}.
895 @item break [@var{duration}]
896 Send a break signal to the current window.  @xref{Break}.
897 @item breaktype [@var{tcsendbreak} | @var{TCSBRK} | @var{TIOCSBRK}]
898 Specify how to generate breaks.  @xref{Break}.
899 @item bufferfile [@var{exchange-file}]
900 Select a file for screen-exchange.  @xref{Screen Exchange}.
901 @item c1 [@var{state}]
902 Change c1 code processing.  @xref{Character Processing}.
903 @item caption @var{mode} [@var{string}]
904 Change caption mode and string.  @xref{Regions}.
905 @item chacl @var{usernames permbits list}
906 Synonym to @code{aclchg}. @xref{Multiuser Session}.
907 @item charset @var{set}
908 Change character set slot designation.  @xref{Character Processing}.
909 @item chdir [@var{directory}]
910 Change the current directory for future windows.  @xref{Chdir}.
911 @item clear
912 Clear the window screen.  @xref{Clear}.
913 @item colon
914 Enter a @code{screen} command.  @xref{Colon}.
915 @item command [-c @var{class}]
916 Simulate the screen escape key.  @xref{Command Character}.
917 @item compacthist [@var{state}]
918 Selects compaction of trailing empty lines.  @xref{Scrollback}.
919 @item console [@var{state}]
920 Grab or ungrab console output.  @xref{Console}.
921 @item copy
922 Enter copy mode.  @xref{Copy}.
923 @item copy_reg [@var{key}]
924 Removed. Use @code{paste} instead.  @xref{Registers}.
925 @item crlf @var{state}
926 Select line break behavior for copying.  @xref{Line Termination}.
927 @item debug @var{state}
928 Suppress/allow debugging output.  @xref{Debug}.
929 @item defautonuke @var{state}
930 Select default autonuke behavior.  @xref{Autonuke}.
931 @item defbce @var{state}
932 Select background color erase.  @xref{Character Processing}.
933 @item defbreaktype [@var{tcsendbreak} | @var{TCSBRK} | @var{TIOCSBRK}]
934 Specify the default for generating breaks.  @xref{Break}.
935 @item defc1 @var{state}
936 Select default c1 processing behavior.  @xref{Character Processing}.
937 @item defcharset [@var{set}]
938 Change defaul character set slot designation.  @xref{Character Processing}.
939 @item defencoding @var{enc}
940 Select default window encoding.  @xref{Character Processing}.
941 @item defescape @var{xy}
942 Set the default command and @code{meta} characters.  @xref{Command Character}.
943 @item defflow @var{fstate}
944 Select default flow control behavior.  @xref{Flow}.
945 @item defgr @var{state}
946 Select default GR processing behavior.  @xref{Character Processing}.
947 @item defhstatus [@var{status}]
948 Select default window hardstatus line.  @xref{Hardstatus}.
949 @item deflog @var{state}
950 Select default window logging behavior.  @xref{Log}.
951 @item deflogin @var{state}
952 Select default utmp logging behavior.  @xref{Login}.
953 @item defmode @var{mode}
954 Select default file mode for ptys.  @xref{Mode}.
955 @item defmonitor @var{state}
956 Select default activity monitoring behavior.  @xref{Monitor}.
957 @item defmousetrack @var{on}|@var{off}
958 Select the default mouse tracking behavior.  @xref{Mousetrack}.
959 @item defnonblock @var{state}|@var{numsecs}
960 Select default nonblock mode.  @xref{Nonblock}.
961 @item defobuflimit @var{limit}
962 Select default output buffer limit.  @xref{Obuflimit}.
963 @item defscrollback @var{num}
964 Set default lines of scrollback.  @xref{Scrollback}.
965 @item defshell @var{command}
966 Set the default program for new windows.  @xref{Shell}.
967 @item defsilence @var{state}
968 Select default idle monitoring behavior.  @xref{Monitor}.
969 @item defslowpaste @var{msec}
970 Select the default inter-character timeout when pasting.  @xref{Paste}.
971 @item defutf8 @var{state}
972 Select default character encoding.  @xref{Character Processing}.
973 @item defwrap @var{state}
974 Set default line-wrapping behavior.  @xref{Wrap}.
975 @item defwritelock @var{on|off|auto}
976 Set default writelock behavior.  @xref{Multiuser Session}.
977 @item defzombie [@var{keys}]
978 Keep dead windows.  @xref{Zombie}.
979 @item detach [-h]
980 Disconnect @code{screen} from the terminal.  @xref{Detach}.
981 @item digraph [@var{preset} [@var{unicode-value}]]
982 Enter a digraph sequence.  @xref{Digraph}.
983 @item dinfo
984 Display terminal information.  @xref{Info}.
985 @item displays
986 List currently active user interfaces. @xref{Displays}.
987 @item dumptermcap
988 Write the window's termcap entry to a file.  @xref{Dump Termcap}.
989 @item echo [-n] @var{message}
990 Display a message on startup.  @xref{Startup}.
991 @item encoding @var{enc} [@var{denc}]
992 Set the encoding of a window.  @xref{Character Processing}.
993 @item escape @var{xy}
994 Set the command and @code{meta} characters.  @xref{Command Character}.
995 @item eval @var{command1} [@var{command2} ...]
996 Parse and execute each argument. @xref{Eval}.
997 @item exec [[@var{fdpat}] @var{command} [@var{args} ...]]
998 Run a subprocess (filter).  @xref{Exec}.
999 @item fit
1000 Change window size to current display size.  @xref{Window Size}.
1001 @item flow [@var{fstate}]
1002 Set flow control behavior.  @xref{Flow}.
1003 @item focus
1004 Move focus to next region.  @xref{Regions}.
1005 @item focusminsize
1006 Force the current region to a certain size.  @xref{Focusminsize}.
1007 @item gr [@var{state}]
1008 Change GR charset processing.  @xref{Character Processing}.
1009 @item group [@var{grouptitle}]
1010 Change or show the group the current window belongs to.  @xref{Window Groups}.
1011 @item hardcopy [-h] [@var{file}]
1012 Write out the contents of the current window.  @xref{Hardcopy}.
1013 @item hardcopy_append @var{state}
1014 Append to hardcopy files.  @xref{Hardcopy}.
1015 @item hardcopydir @var{directory}
1016 Place, where to dump hardcopy files.  @xref{Hardcopy}.
1017 @item hardstatus [@var{state}]
1018 Use the hardware status line.  @xref{Hardware Status Line}.
1019 @item height [@var{lines} [@var{cols}]]
1020 Set display height.  @xref{Window Size}.
1021 @item help [-c @var{class}]
1022 Display current key bindings.  @xref{Help}.
1023 @item history
1024 Find previous command beginning @dots{}.  @xref{History}.
1025 @item hstatus @var{status}
1026 Change the window's hardstatus line.  @xref{Hardstatus}.
1027 @item idle [@var{timeout} [@var{cmd} @var{args}]]
1028 Define a screen saver command.  @xref{Screen Saver}.
1029 @item ignorecase [on|off]
1030 Ignore character case in searches.  @xref{Searching}.
1031 @item info
1032 Display window settings.  @xref{Info}.
1033 @item ins_reg [@var{key}]
1034 Removed, use @code{paste} instead.  @xref{Registers}.
1035 @item kill
1036 Destroy the current window.  @xref{Kill}.
1037 @item lastmsg
1038 Redisplay the last message.  @xref{Last Message}.
1039 @item layout new [@var{title}]
1040 Create a layout.  @xref{Layout}.
1041 @item layout remove [@var{n}|@var{title}]
1042 Delete a layout.  @xref{Layout}.
1043 @item layout next
1044 Select the next layout.  @xref{Layout}.
1045 @item layout prev
1046 Select the previous layout.  @xref{Layout}.
1047 @item layout select [@var{n}|@var{title}]
1048 Jump to a layout.  @xref{Layout}.
1049 @item layout show
1050 List the available layouts.  @xref{Layout}.
1051 @item layout title [@var{title}]
1052 Show or set the title of a layout.  @xref{Layout}.
1053 @item layout number [@var{n}]
1054 Show or set the number of a layout.  @xref{Layout}.
1055 @item layout attach [@var{title}|:last]
1056 Show or set which layout to reattach to.  @xref{Layout}.
1057 @item layout save [@var{n}|@var{title}]
1058 Remember the organization of a layout.  @xref{Layout}.
1059 @item layout autosave [@var{on}|@var{off}]
1060 Show or set the status of layout saving.  @xref{Layout}.
1061 @item layout dump [filename]
1062 Save the layout arrangement to a file.  @xref{Layout}.
1063 @item license
1064 Display licensing information.  @xref{Startup}.
1065 @item lockscreen
1066 Lock the controlling terminal.  @xref{Lock}.
1067 @item log [@var{state}]
1068 Log all output in the current window.  @xref{Log}.
1069 @item logfile @var{filename}
1070 Place where to collect logfiles.  @xref{Log}.
1071 @item login [@var{state}]
1072 Log the window in @file{/etc/utmp}.  @xref{Login}.
1073 @item logtstamp [@var{state}]
1074 Configure logfile time-stamps.  @xref{Log}.
1075 @item mapdefault
1076 Use only the default mapping table for the next keystroke.  @xref{Bindkey Control}.
1077 @item mapnotnext
1078 Don't try to do keymapping on the next keystroke.  @xref{Bindkey Control}.
1079 @item maptimeout @var{n}
1080 Set the inter-character timeout used for keymapping. @xref{Bindkey Control}.
1081 @item markkeys @var{string}
1082 Rebind keys in copy mode.  @xref{Copy Mode Keys}.
1083 @item maxwin @var{n}
1084 Set the maximum window number. @xref{Maxwin}.
1085 @item meta
1086 Insert the command character.  @xref{Command Character}.
1087 @item monitor [@var{state}]
1088 Monitor activity in window.  @xref{Monitor}.
1089 @item mousetrack [@var{on}|@var{off}]
1090 Enable selecting split regions with mouse clicks.  @xref{Mousetrack}.
1091 @item msgminwait @var{sec}
1092 Set minimum message wait.  @xref{Message Wait}.
1093 @item msgwait @var{sec}
1094 Set default message wait.  @xref{Message Wait}.
1095 @item multiuser @var{state}
1096 Go into single or multi user mode. @xref{Multiuser Session}.
1097 @item nethack @var{state}
1098 Use @code{nethack}-like error messages.  @xref{Nethack}.
1099 @item next
1100 Switch to the next window.  @xref{Selecting}.
1101 @item nonblock [@var{state}|@var{numsecs}]
1102 Disable flow control to the current display. @xref{Nonblock}.|@var{numsecs}]
1103 @item number [@var{n}]
1104 Change/display the current window's number.  @xref{Number}.
1105 @item obuflimit [@var{limit}]
1106 Select output buffer limit.  @xref{Obuflimit}.
1107 @item only
1108 Kill all other regions.  @xref{Regions}.
1109 @item other
1110 Switch to the window you were in last.  @xref{Selecting}.
1111 @item partial @var{state}
1112 Set window to partial refresh.  @xref{Redisplay}.
1113 @item password [@var{crypted_pw}]
1114 Set reattach password.  @xref{Detach}.
1115 @item paste [@var{src_regs} [@var{dest_reg}]]
1116 Paste contents of paste buffer or registers somewhere.  @xref{Paste}.
1117 @item pastefont [@var{state}]
1118 Include font information in the paste buffer.  @xref{Paste}.
1119 @item pow_break
1120 Close and Reopen the window's terminal.  @xref{Break}.
1121 @item pow_detach
1122 Detach and hang up.  @xref{Power Detach}.
1123 @item pow_detach_msg [@var{message}]
1124 Set message displayed on @code{pow_detach}.  @xref{Power Detach}.
1125 @item prev
1126 Switch to the previous window.  @xref{Selecting}.
1127 @item printcmd [@var{cmd}]
1128 Set a command for VT100 printer port emulation.  @xref{Printcmd}.
1129 @item process [@var{key}]
1130 Treat a register as input to @code{screen}.  @xref{Registers}.
1131 @item quit
1132 Kill all windows and exit.  @xref{Quit}.
1133 @item readbuf [-e @var{encoding}] [@var{filename}]
1134 Read the paste buffer from the screen-exchange file.  @xref{Screen Exchange}.
1135 @item readreg [-e @var{encoding}] [@var{reg} [@var{file}]]
1136 Load a register from paste buffer or file.  @xref{Registers}.
1137 @item redisplay
1138 Redisplay the current window.  @xref{Redisplay}.
1139 @item register [-e @var{encoding}] @var{key} @var{string}
1140 Store a string to a register.  @xref{Registers}.
1141 @item remove
1142 Kill current region.  @xref{Regions}.
1143 @item removebuf
1144 Delete the screen-exchange file.  @xref{Screen Exchange}.
1145 @item rendition bell | monitor | silence | so @var{attr} [@var{color}]
1146 Change text attributes in caption for flagged windows.  @xref{Rendition}.
1147 @item reset
1148 Reset the terminal settings for the window.  @xref{Reset}.
1149 @item resize [(+/-)lines]
1150 Grow or shrink a region
1151 @item screen [@var{opts}] [@var{n}] [@var{cmd} [@var{args}] | //group]
1152 Create a new window.  @xref{Screen Command}.
1153 @item scrollback @var{num}
1154 Set size of scrollback buffer.  @xref{Scrollback}.
1155 @item select [@var{n}|-|.]
1156 Switch to a specified window.  @xref{Selecting}.
1157 @item sessionname [@var{name}]
1158 Name this session.  @xref{Session Name}.
1159 @item setenv [@var{var} [@var{string}]]
1160 Set an environment variable for new windows.  @xref{Setenv}.
1161 @item setsid @var{state}
1162 Controll process group creation for windows.  @xref{Setsid}.
1163 @item shell @var{command}
1164 Set the default program for new windows.  @xref{Shell}.
1165 @item shelltitle @var{title}
1166 Set the default name for new windows.  @xref{Shell}.
1167 @item silence [@var{state}|@var{seconds}]
1168 Monitor a window for inactivity.  @xref{Monitor}.
1169 @item silencewait @var{seconds}
1170 Default timeout to trigger an inactivity notify.  @xref{Monitor}.
1171 @item sleep @var{num}
1172 Pause during startup.  @xref{Startup}.
1173 @item slowpaste @var{msec}
1174 Slow down pasting in windows.  @xref{Paste}.
1175 @item source @var{file}
1176 Run commands from a file.  @xref{Source}.
1177 @item sorendition [@var{attr} [@var{color}]]
1178 Deprecated. Use @code{rendition so} instead. @xref{Rendition}.
1179 @item split
1180 Split region into two parts.  @xref{Regions}.
1181 @item startup_message @var{state}
1182 Display copyright notice on startup.  @xref{Startup}.
1183 @item stuff [@var{string}]
1184 Stuff a string in the input buffer of a window.  @xref{Paste}.
1185 @item su [@var{username} [@var{password} [@var{password2}]]]
1186 Identify a user. @xref{Multiuser Session}.
1187 @item suspend
1188 Put session in background.  @xref{Suspend}.
1189 @item term @var{term}
1190 Set @code{$TERM} for new windows.  @xref{Term}.
1191 @item termcap @var{term} @var{terminal-tweaks} [@var{window-tweaks}]
1192 Tweak termcap entries for best performance.  @xref{Termcap Syntax}.
1193 @item terminfo @var{term} @var{terminal-tweaks} [@var{window-tweaks}]
1194 Ditto, for terminfo systems.  @xref{Termcap Syntax}.
1195 @item termcapinfo @var{term} @var{terminal-tweaks} [@var{window-tweaks}]
1196 Ditto, for both systems.  @xref{Termcap Syntax}.
1197 @item time [@var{string}]
1198 Display time and load average.  @xref{Time}.
1199 @item title [@var{windowtitle}]
1200 Set the name of the current window.  @xref{Title Command}.
1201 @item umask [@var{users}]+/-@var{bits} ...
1202 Synonym to @code{aclumask}. @xref{Umask}.
1203 @item unbindall
1204 Unset all keybindings. @xref{Bind}.
1205 @item unsetenv @var{var}
1206 Unset environment variable for new windows.  @xref{Setenv}.
1207 @item utf8 [@var{state} [@var{dstate}]]
1208 Select character encoding of the current window.  @xref{Character Processing}.
1209 @item vbell [@var{state}]
1210 Use visual bell.  @xref{Bell}.
1211 @item vbell_msg [@var{message}]
1212 Set vbell message.  @xref{Bell}.
1213 @item vbellwait @var{sec}
1214 Set delay for vbell message.  @xref{Bell}.
1215 @item version
1216 Display @code{screen} version.  @xref{Version}.
1217 @item wall @var{message}
1218 Write a message to all displays.  @xref{Multiuser Session}.
1219 @item width [@var{cols} [@var{lines}]]
1220 Set the width of the window.  @xref{Window Size}.
1221 @item windowlist [[-b] [-m] [-g]] | string [@var{string}] | title [@var{title}]
1222 Present a list of all windows for selection.  @xref{Windowlist}.
1223 @item windows
1224 List active windows.  @xref{Windows}.
1225 @item wrap [ on | off ]
1226 Control line-wrap behavior.  @xref{Wrap}.
1227 @item writebuf [-e @var{encoding}] [@var{filename}]
1228 Write paste buffer to screen-exchange file.  @xref{Screen Exchange}.
1229 @item writelock @var{on}|@var{off}|@var{auto}
1230 Grant exclusive write permission.  @xref{Multiuser Session}.
1231 @item xoff
1232 Send an XOFF character.  @xref{XON/XOFF}.
1233 @item xon
1234 Send an XON character.  @xref{XON/XOFF}.
1235 @item zmodem [off|auto|catch|pass]
1236 Define how screen treats zmodem requests.  @xref{Zmodem}.
1237 @item zombie [@var{keys} [onerror] ]
1238 Keep dead windows.  @xref{Zombie}.
1239 @end table
1241 @node New Window, Selecting, Commands, Top
1242 @chapter New Window
1244 This section describes the commands for creating a new window for
1245 running programs.  When a new window is created, the first available
1246 number is assigned to it.
1247 The number of windows is limited at compile-time by the MAXWIN
1248 configuration parameter (which defaults to 40).
1250 @menu
1251 * Chdir::                       Change the working directory for new windows.
1252 * Screen Command::              Create a new window.
1253 * Setenv::                      Set environment variables for new windows.
1254 * Shell::                       Parameters for shell windows.
1255 * Term::                        Set the terminal type for new windows.
1256 * Window Types::                Creating different types of windows.
1257 * Window Groups::               Grouping windows together
1258 @end menu
1260 @node Chdir, Screen Command,  , New Window
1261 @section Chdir
1262 @deffn Command chdir [directory]
1263 (none)@*
1264 Change the current directory of @code{screen} to the specified directory
1265 or, if called without an argument, to your home directory (the value of
1266 the environment variable @code{$HOME}).  All windows that are created by means
1267 of the @code{screen} command from within @file{.screenrc} or by means of
1268 @kbd{C-a : screen @dots{}} or @kbd{C-a c} use this as their default
1269 directory.  Without a @code{chdir} command, this would be the directory
1270 from which @code{screen} was invoked.  Hardcopy and log files are always
1271 written to the @emph{window's} default directory, @emph{not} the current
1272 directory of the process running in the window.  You can use this
1273 command multiple times in your @file{.screenrc} to start various windows
1274 in different default directories, but the last @code{chdir} value will
1275 affect all the windows you create interactively.
1276 @end deffn
1278 @node Screen Command, Setenv, Chdir, New Window
1279 @section Screen Command
1280 @kindex c
1281 @kindex C-c
1282 @deffn Command screen [opts] [n] [cmd [args] @var{| //group}]
1283 (@kbd{C-a c}, @kbd{C-a C-c})@*
1284 Establish a new window.  The flow-control options (@samp{-f}, @samp{-fn}
1285 and @samp{-fa}), title option (@samp{-t}), login options
1286 (@samp{-l} and @samp{-ln}) , terminal type option (@samp{-T @var{term}}),
1287 the all-capability-flag (@samp{-a}) and scrollback option 
1288 (@samp{-h @var{num}}) may be specified with each command. 
1289 The option (@samp{-M}) turns monitoring on for this window.
1290 The option (@samp{-L}) turns output logging on for this window.
1291 If an optional number @var{n} in the range 0@dots{}MAXWIN-1 is given,
1292 the window number @var{n} is assigned to the newly created window (or,
1293 if this number is already in-use, the next available number).  If a
1294 command is specified after @code{screen}, this command (with the given
1295 arguments) is started in the window; otherwise, a shell is created.
1296 If @samp{//group} is supplied, a container-type window is created in
1297 which other windows may be created inside it. @xref{Window Groups}.
1299 Screen has built in some functionality of @samp{cu} and @samp{telnet}.
1300 @xref{Window Types}.
1301 @end deffn
1303 Thus, if your @file{.screenrc} contains the lines
1305 @example
1306 # example for .screenrc:
1307 screen 1
1308 screen -fn -t foobar 2 -L telnet foobar
1309 @end example
1311 @noindent
1312 @code{screen} creates a shell window (in window #1) and a window with a
1313 TELNET connection to the machine foobar (with no flow-control using the
1314 title @samp{foobar} in window #2) and will write a logfile @samp{screenlog.2}
1315 of the telnet session.  If you do not include any
1316 @code{screen} commands in your @file{.screenrc} file, then @code{screen}
1317 defaults to creating a single shell window, number zero.  When the
1318 initialization is completed, @code{screen} switches to the last window
1319 specified in your .screenrc file or, if none, it opens default window
1322 @node Setenv, Shell, Screen Command, New Window
1323 @section Setenv
1324 @deffn Command setenv var string
1325 (none)@*
1326 Set the environment variable @var{var} to value @var{string}.
1327 If only @var{var} is specified, the user will be prompted to enter a value.
1328 If no parameters are specified, the user will be prompted for both variable
1329 and value. The environment is inherited by all subsequently forked shells.
1330 @end deffn
1332 @deffn Command unsetenv var
1333 (none)@*
1334 Unset an environment variable.
1335 @end deffn
1337 @node Shell, Term, Setenv, New Window
1338 @section Shell
1339 @deffn Command shell command
1340 @deffnx Command defshell command
1341 (none)@*
1342 Set the command to be used to create a new shell.  This overrides the
1343 value of the environment variable @code{$SHELL}.  This is useful if
1344 you'd like to run a tty-enhancer which is expecting to execute the
1345 program specified in @code{$SHELL}.  If the command begins with
1346 a @samp{-} character, the shell will be started as a login-shell.
1348 @code{defshell} is currently a synonym to the @code{shell} command.
1349 @end deffn
1351 @deffn Command shelltitle title
1352 (none)@*
1353 Set the title for all shells created during startup or by the C-a C-c
1354 command.  @xref{Naming Windows}, for details about what titles are.
1355 @end deffn
1357 @node Term, Window Types , Shell, New Window
1358 @section Term
1359 @deffn Command term term
1360 (none)@*
1361 In each window @code{screen} opens, it sets the @code{$TERM}
1362 variable to @code{screen} by default, unless no description for
1363 @code{screen} is installed in the local termcap or terminfo data base.
1364 In that case it pretends that the terminal emulator is @samp{vt100}.
1365 This won't do much harm, as @code{screen} is VT100/ANSI compatible.  The
1366 use of the @code{term} command is discouraged for non-default purpose.
1367 That is, one may want to specify special @code{$TERM} settings (e.g. vt100) for
1368 the next @code{screen rlogin othermachine} command. Use the command
1369 @code{screen -T vt100 rlogin othermachine} rather than setting
1370 and resetting the default.
1371 @end deffn
1373 @node Window Types, Window Groups, Term, New Window
1374 @section Window Types
1375 @cindex window types
1376 Screen provides three different window types. New windows are created
1377 with @code{screen}'s @samp{screen} command (@pxref{Screen Command}).
1378 The first parameter to the @samp{screen} command defines which
1379 type of window is created. The different window types are all
1380 special cases of the normal type. They have been added in order
1381 to allow @code{screen} to be used efficiently as a console
1382 with 100 or more windows.
1383 @itemize @bullet
1384 @item
1385 The normal window contains a shell (default, if no parameter is given)
1386 or any other system command that could be executed from a shell.
1387 (e.g. @samp{slogin}, etc...).
1389 @item
1390 If a tty (character special device) name (e.g. @samp{/dev/ttya})
1391 is specified as the first parameter, then the window is directly
1392 connected to this device.
1393 This window type is similar to @samp{screen cu -l /dev/ttya}.
1394 Read and write access is required on the device node,
1395 an exclusive open is attempted on the node to mark the connection line
1396 as busy.
1397 An optional parameter is allowed consisting of a comma separated
1398 list of flags in the notation used by @samp{stty(1)}:
1399 @table @code
1400 @item <baud_rate>
1401 Usually 300, 1200, 9600 or 19200. This affects transmission as well as
1402 receive speed.
1403 @item cs8 or cs7
1404 Specify the transmission of eight (or seven) bits per byte.
1405 @item ixon or -ixon
1406 Enables (or disables) software flow-control (CTRL-S/CTRL-Q) for sending
1407 data.
1408 @item ixoff or -ixoff
1409 Enables (or disables) software flow-control for receiving data.
1410 @item istrip or -istrip
1411 Clear (or keep) the eight bit in each received byte.
1412 @end table
1414 You may want to specify as many of these options as applicable.
1415 Unspecified options cause the terminal driver to make up the parameter
1416 values of the connection. These values are system-dependent and may be
1417 in defaults or values saved from a previous connection.
1419 For tty windows, the @code{info} command shows some of the modem
1420 control lines in the status line.
1421 These may include @samp{RTS}, @samp{CTS}, @samp{DTR}, @samp{CD} and
1422 more. This depends rather on on the available @code{ioctl()}'s and system
1423 header files than on the physical capabilities of the serial board. 
1424 The name of a logical low (inactive) signal is preceded by an 
1425 exclamation mark (@samp{!}), otherwise the signal is logical high (active).
1426 Unsupported but shown signals are usually shown low.
1427 When the @code{CLOCAL} status bit is true, the whole set of modem signals is 
1428 placed inside curly braces (@samp{@{} and @samp{@}}).
1429 When the @code{CRTSCTS} or @code{TIOCSOFTCAR} bit is true, the signals 
1430 @samp{CTS} or @samp{CD} are shown in parenthesis, respectively.
1432 For tty windows, the command @code{break} causes the Data transmission
1433 line (TxD) to go low for a specified period of time. This is expected
1434 to be interpreted as break signal on the other side.
1435 No data is sent and no modem control line is changed when a
1436 @code{break} is issued.
1438 @item
1439 If the first parameter is @code{//telnet}, the second parameter is
1440 expected to be a host name, and an optional third parameter may specify
1441 a TCP port number (default decimal 23). Screen will connect to a
1442 server listening on the remote host and use the telnet protocol to
1443 communicate with that server.
1445 For telnet windows, the command @code{info} shows details about
1446 the connection in square brackets (@samp{[} and @samp{]}) at the end of
1447 the status line.
1448 @table @code
1449 @item b
1450 BINARY. The connection is in binary mode.
1451 @item e
1452 ECHO. Local echo is disabled.
1453 @item c
1454 SGA. The connection is in `character mode' (default: `line mode').
1455 @item t
1456 TTYPE. The terminal type has been requested by the remote host. Screen
1457 sends the name @code{screen} unless instructed otherwise (see also the
1458 command @samp{term}).
1459 @item w
1460 NAWS. The remote site is notified about window size changes.
1461 @item f
1462 LFLOW. The remote host will send flow control information.
1463 (Ignored at the moment.)
1464 @end table
1465 Additional flags for debugging are @samp{x}, @samp{t} and @samp{n}
1466 (XDISPLOC, TSPEED and NEWENV).
1468 For telnet windows, the command @code{break} sends the telnet code
1469 @code{IAC BREAK} (decimal 243) to the remote host.
1471 @end itemize
1473 @node Window Groups, , Window Types, New Window
1474 @section Window Groups
1475 @cindex window groups
1476 Screen provides a method for grouping windows together. Windows can be
1477 organized in a hierarchical fashion, resembling a tree structure. New
1478 screens are created using the @code{screen} command while new groups
1479 are created using @code{screen //group}. @xref{Screen Command}. 
1481 Once a new group is created, it will act as a container for windows
1482 and even other groups. When a group is selected, you will see the
1483 output of the @code{windowlist} command, allowing you to select a
1484 window inside. If there are no windows inside a group, use the 
1485 @code{screen} command to create one. Once inside a group, using the
1486 commands @code{next} and @code{prev} will switch between windows only
1487 in that group. Using the @code{windowlist} command will give you the
1488 opportunity to leave the group you are in. @xref{Windowlist}.
1490 @deffn Command group [grouptitle]
1491 (none)@*
1492 Change or show the group the current window belongs to. Windows can
1493 be moved around between different groups by specifying the name of
1494 the destination group. Without specifying a group, the title of the
1495 current group is displayed.
1496 @end deffn
1498 Using groups in combination with layouts will help create a 
1499 multi-desktop experience. One group can be assigned for each
1500 layout made. Windows can be made, split, and organized within each
1501 group as desired. Afterwhich, switching between groups can be as easy
1502 as switching layouts.
1504 @node Selecting, Session Management, New Window, Top
1505 @chapter Selecting a Window
1507 This section describes the commands for switching between windows in an
1508 @code{screen} session.  The windows are numbered from 0 to 9, and are created
1509 in that order by default (@pxref{New Window}).
1511 @menu
1512 * Next and Previous::           Forward or back one window.
1513 * Other Window::                Switch back and forth between two windows.
1514 * Select::                      Switch to a window (and to one after @code{kill}).
1515 * Windowlist::                  Present a list of all windows for selection.
1516 @end menu
1518 @node Next and Previous, Other Window,  , Selecting
1519 @section Moving Back and Forth
1520 @kindex SPC
1521 @kindex n
1522 @kindex C-n
1523 @deffn Command next
1524 (@kbd{C-a @key{SPC}}, @kbd{C-a n}, @kbd{C-a C-n})@*
1525 Switch to the next window.  This command can be used repeatedly to
1526 cycle through the list of windows.  (On some terminals, C-@key{SPC}
1527 generates a NUL character, so you must release the control key before
1528 pressing space.)
1529 @end deffn
1531 @kindex p
1532 @kindex C-p
1533 @kindex C-h
1534 @kindex Backspace
1535 @deffn Command prev
1536 (@kbd{C-a p}, @kbd{C-a C-p}, @kbd{C-a C-h}, @kbd{C-a @key{Backspace}})@*
1537 Switch to the previous window (the opposite of @kbd{C-a n}).
1538 @end deffn
1540 @node Other Window, Select, Next and Previous, Selecting
1541 @section Other Window
1542 @kindex C-a
1543 @deffn Command other
1544 (@kbd{C-a C-a})@*
1545 Switch to the last window displayed.  Note that this command
1546 defaults to the command character typed twice, unless overridden.
1547 For instance, if you use the option @samp{-e]x}, 
1548 this command becomes @kbd{]]} (@pxref{Command Character}).
1549 @end deffn
1551 @node Select, Windowlist, Other Window, Selecting
1552 @section Select
1553 @kindex 0@dots{}9
1554 @kindex '
1555 @deffn Command select [n @var{|-|.}]
1556 (@kbd{C-a @var{n}}, @kbd{C-a '})@*
1557 Switch to the window with the number @var{n}.
1558 If no window number is specified, you get prompted for an 
1559 identifier. This can be a window name (title) or a number.
1560 When a new window is established, the lowest available number
1561 is assigned to this window.
1562 Thus, the first window can be activated by @code{select 0}; there
1563 can be no more than 10 windows present simultaneously (unless screen is
1564 compiled with a higher MAXWIN setting).
1565 There are two special arguments, @code{select -} switches to the
1566 internal blank window and @code{select .} switches to the
1567 current window. The latter is useful if used with screen's
1568 @code{-X} option.
1570 @end deffn
1572 @node Windowlist, , Select, Selecting
1573 @section Windowlist
1574 @kindex "
1575 @deffn Command windowlist [-b] [-m] [-g]
1576 @deffnx Command windowlist string [@var{string}]
1577 @deffnx Command windowlist title [@var{title}]
1578 (@kbd{C-a "})@*
1579 Display all windows in a table for visual window selection.
1580 If screen was in a window group, screen will
1581 back out of the group and then display the windows in that
1582 group. If the @code{-b} option is given, screen will
1583 switch to the blank window before presenting the list, so
1584 that the current window is also selectable.
1585 The @code{-m} option changes the order of the windows, instead of
1586 sorting by window numbers screen uses its internal most-recently-used
1587 list. The @code{-g} option will show the windows inside any groups
1588 in that level and downwards.
1590 The following keys are used to navigate in @code{windowlist}:
1592 @noindent
1593 @kbd{k}, @kbd{C-p}, or @kbd{up} Move up one line.
1595 @noindent
1596 @kbd{j}, @kbd{C-n}, or @kbd{down} Move down one line.
1598 @noindent
1599 @kbd{C-g} or @kbd{escape} Exit windowlist.
1601 @noindent
1602 @kbd{C-a} or @kbd{home} Move to the first line.
1604 @noindent
1605 @kbd{C-e} or @kbd{end} Move to the last line.
1607 @noindent
1608 @kbd{C-u} or @kbd{C-d} Move one half page up or down.
1610 @noindent
1611 @kbd{C-b} or @kbd{C-f} Move one full page up or down.
1613 @indent
1614 @kbd{0..9} Using the number keys, move to the selected line.
1616 @noindent
1617 @kbd{mouseclick} Move to the selected line. Available when
1618 @code{mousetrack} is set to @code{on}.
1620 @noindent
1621 @kbd{/} Search.
1623 @noindent
1624 @kbd{n} Repeat search in the forward direction.
1626 @noindent
1627 @kbd{N} Repeat search in the backward direction.
1629 @noindent
1630 @kbd{m} Toggle MRU.
1632 @noindent
1633 @kbd{g} Toggle group nesting.
1635 @noindent
1636 @kbd{a} All window view.
1638 @noindent
1639 @kbd{C-h} or @kbd{backspace} Back out the group.
1641 @noindent
1642 @kbd{,} Switch numbers with the previous window.
1644 @noindent
1645 @kbd{.} Switch numbers with the next window.
1647 @noindent
1648 @kbd{K} Kill that window.
1650 @noindent
1651 @kbd{space} or @kbd{enter} Select that window.
1653 The table format can be changed with the string and title
1654 option, the title is displayed as table heading, while the
1655 lines are made by using the string setting.  The default
1656 setting is @samp{Num Name%=Flags} for the title and
1657 @samp{%3n %t%=%f} for the lines. See the string escapes chapter
1658 (@pxref{String Escapes}) for more codes (e.g. color settings).
1660 @code{Windowlist} needs a region size of at least 10 characters
1661 wide and 6 characters high in order to display.
1662 @end deffn
1664 @node Session Management, Regions, Selecting, Top
1665 @chapter Session Management Commands
1667 Perhaps the most useful feature of @code{screen} is the way it allows
1668 the user to move a session between terminals, by detaching and
1669 reattaching.  This also makes life easier for modem users who have to
1670 deal with unexpected loss of carrier.
1672 @menu
1673 * Detach::                      Disconnect @code{screen} from your terminal.
1674 * Power Detach::                Detach and log out.
1675 * Lock::                        Lock your terminal temporarily.
1676 * Multiuser Session::           Changing number of allowed users.
1677 * Session Name::                Rename your session for later reattachment.
1678 * Suspend::                     Suspend your session.
1679 * Quit::                        Terminate your session.
1680 @end menu
1682 @node Detach, Power Detach,  , Session Management
1683 @section Detach
1685 @deffn Command autodetach state
1686 (none)@*
1687 Sets whether @code{screen} will automatically detach upon hangup, which
1688 saves all your running programs until they are resumed with a
1689 @code{screen -r} command.  When turned off, a hangup signal will
1690 terminate @code{screen} and all the processes it contains. Autodetach is
1691 on by default.
1692 @end deffn
1694 @kindex d
1695 @kindex C-d
1696 @deffn Command detach
1697 (@kbd{C-a d}, @kbd{C-a C-d})@*
1698 Detach the @code{screen} session (disconnect it from the terminal and
1699 put it into the background).  A detached @code{screen} can be resumed by
1700 invoking @code{screen} with the @code{-r} option (@pxref{Invoking
1701 Screen}).
1702 The @code{-h} option tells screen to immediately close the connection
1703 to the terminal (@samp{hangup}).
1704 @end deffn
1706 @deffn Command password [crypted_pw]
1707 (none)@*
1708 Present a crypted password in your @file{.screenrc} file and screen will
1709 ask for it, whenever someone attempts to resume a detached session. This
1710 is useful, if you have privileged programs running under @code{screen}
1711 and you want to protect your session from reattach attempts by users
1712 that managed to assume your uid. (I.e. any superuser.)  If no crypted
1713 password is specified, screen prompts twice a password and places its
1714 encryption in the paste buffer.  Default is `none', which disables
1715 password checking.
1716 @end deffn
1718 @node Power Detach, Lock, Detach, Session Management
1719 @section Power Detach
1721 @kindex D
1722 @deffn Command pow_detach
1723 (@kbd{C-a D D})@*
1724 Mainly the same as @code{detach}, but also sends a HANGUP signal
1725 to the parent process of @code{screen}.@*
1726 @emph{Caution}: This will result in a
1727 logout if @code{screen} was started from your login shell.
1728 @end deffn
1730 @deffn Command pow_detach_msg [message]
1731 (none)@*
1732 The @var{message} specified here is output whenever a power detach is
1733 performed. It may be used as a replacement for a logout message or to reset 
1734 baud rate, etc.
1735 Without a parameter, the current message is shown.
1736 @end deffn
1738 @node Lock, Multiuser Session, Power Detach, Session Management
1739 @section Lock
1740 @kindex x
1741 @kindex C-x
1742 @deffn Command lockscreen
1743 (@kbd{C-a x}, @kbd{C-a C-x})@*
1744 Call a screenlock program (@file{/local/bin/lck} or @file{/usr/bin/lock}
1745 or a builtin, if no other is available). Screen does not accept any
1746 command keys until this program terminates. Meanwhile processes in the
1747 windows may continue, as the windows are in the detached state.
1748 The screenlock program may be changed through the environment variable
1749 @code{$LOCKPRG} (which must be set in the shell from which @code{screen}
1750 is started) and is executed with the user's uid and gid.
1752 Warning: When you leave other shells unlocked and have no password set
1753 on @code{screen}, the lock is void: One could easily re-attach from an
1754 unlocked shell. This feature should rather be called
1755 @code{lockterminal}.
1756 @end deffn
1758 @node Multiuser Session, Session Name, Lock, Session Management
1759 @section Multiuser Session
1760 @cindex multiuser session 
1762 These commands allow other users to gain access to one single @code{screen}
1763 session. When attaching to a multiuser @code{screen} the sessionname is 
1764 specified as @code{username/sessionname} to the @code{-S} command line option.
1765 @code{Screen} must be compiled with multiuser support to enable features 
1766 described here.
1768 @menu
1769 * Multiuser::                   Enable / Disable multiuser mode.
1770 * Acladd::                      Enable a specific user.
1771 * Aclchg::                      Change a users permissions.
1772 * Acldel::                      Disable a specific user.
1773 * Aclgrp::                      Grant a user permissions to other users.
1774 * Displays::                    List all active users at their displays.
1775 * Umask::                       Predefine access to new windows.
1776 * Wall::                        Write a message to all users.
1777 * Writelock::                   Grant exclusive window access.
1778 * Su::                          Substitute user.
1779 @end menu
1781 @node Multiuser, Acladd,  , Multiuser Session
1782 @subsection Multiuser
1783 @deffn Command multiuser @var{state}
1784 (none)@*
1785 Switch between single-user and multi-user mode. Standard screen operation is 
1786 single-user. In multi-user mode the commands @code{acladd}, @code{aclchg} and 
1787 @code{acldel} can be used to enable (and disable) other users accessing this 
1788 @code{screen}.  
1789 @end deffn
1791 @node Acladd, Aclchg, Multiuser, Multiuser Session
1792 @subsection Acladd
1793 @deffn Command acladd @var{usernames}
1794 @deffnx Command addacl @var{usernames}
1795 (none)@*
1796 Enable users to fully access this screen session. @var{Usernames} can be one 
1797 user or a comma separated list of users. This command enables to attach to
1798 the @code{screen} session and performs the equivalent of
1799 @code{aclchg @var{usernames} +rwx "#?"}. To add a user with restricted access,
1800 use the @code{aclchg} command below. 
1801 @code{Addacl} is a synonym to @code{acladd}.
1802 Multi-user mode only.
1803 @end deffn
1805 @node Aclchg, Acldel, Acladd, Multiuser Session
1806 @subsection Aclchg
1807 @deffn Command aclchg @var{usernames permbits list}
1808 @deffnx Command chacl @var{usernames permbits list}
1809 (none)@*
1810 Change permissions for a comma separated list of users. 
1811 Permission bits are represented as @samp{r}, @samp{w} and @samp{x}. 
1812 Prefixing @samp{+} grants the permission, @samp{-} removes it. The third 
1813 parameter is a comma separated list of commands or windows (specified either 
1814 by number or title). The special list @samp{#} refers to all windows, @samp{?} 
1815 to all commands. If @var{usernames} consists of a single @samp{*}, all 
1816 known users are affected. 
1817 A command can be executed when the user has the @samp{x} bit for it. The user
1818 can type input to a window when he has its @samp{w} bit set and no other
1819 user obtains a writelock for this window. Other bits are currently ignored.
1820 To withdraw the writelock from another user in e.g. window 2:
1821 @samp{aclchg @var{username} -w+w 2}. To allow read-only access 
1822 to the session: @samp{aclchg @var{username} -w "#"}. As soon as a user's name 
1823 is known to screen, he can attach to the session and (per default) has full 
1824 permissions for all command and windows. Execution permission for the acl 
1825 commands, @code{at} and others should also be removed or the user may be able 
1826 to regain write permission.
1827 @code{Chacl} is a synonym to @code{aclchg}.
1828 Multi-user mode only.
1829 @end deffn
1831 @node Acldel, Aclgrp, Aclchg, Multiuser Session
1832 @subsection Acldel
1833 @deffn Command acldel @var{username}
1834 (none)@*
1835 Remove a user from screen's access control list. If currently attached, all the
1836 user's displays are detached from the session. He cannot attach again.
1837 Multi-user mode only.
1838 @end deffn
1840 @node Aclgrp, Displays, Acldel, Multiuser Session
1841 @subsection Aclgrp
1842 @deffn Command aclgrp @var{username} [@var{groupname}]
1843 (none)@*
1844 Creates groups of users that share common access rights. The
1845 name  of the group is the username of the group leader. Each
1846 member of  the  group  inherits  the  permissions  that  are
1847 granted  to the group leader. That means, if a user fails an
1848 access check, another check is made for the group leader.
1849 A user is removed from all groups the special value @samp{none}
1850 is used for @var{groupname}. If the second parameter is omitted
1851 all groups the user is in are listed.
1852 @end deffn
1854 @node Displays, Umask, Aclgrp, Multiuser Session
1855 @subsection Displays
1856 @kindex *
1857 @deffn Command displays
1858 (@kbd{C-a *})@*
1859 Shows a tabular listing  of  all  currently  connected  user
1860 front-ends  (displays).   This  is most useful for multiuser
1861 sessions.
1863 The following keys can be used in @code{displays} list:
1865 @noindent
1866 @kbd{k}, @kbd{C-p}, or @kbd{up} Move up one line.
1868 @noindent
1869 @kbd{j}, @kbd{C-n}, or @kbd{down} Move down one line.
1871 @noindent
1872 @kbd{C-a} or @kbd{home} Move to the first line.
1874 @noindent
1875 @kbd{C-e} or @kbd{end} Move to the last line.
1877 @noindent
1878 @kbd{C-u} or @kbd{C-d} Move one half page up or down.
1880 @noindent
1881 @kbd{C-b} or @kbd{C-f} Move one full page up or down.
1883 @noindent
1884 @kbd{mouseclick} Move to the selected line. Available when
1885 @code{mousetrack} is set to @code{on}.
1887 @noindent
1888 @kbd{space} Refresh the list.
1890 @noindent
1891 @kbd{d} Detach the selected display.
1893 @noindent
1894 @kbd{D} Power detach the selected display.
1896 @noindent
1897 @kbd{C-g}, @kbd{enter}, or @kbd{escape} Exit the list.
1900 The following is an example of what @code{displays} could
1901 look like:
1903 @example
1904 xterm 80x42   jnweiger@@/dev/ttyp4      0(m11)    &rWx
1905 facit 80x24   mlschroe@@/dev/ttyhf nb  11(tcsh)    rwx
1906 xterm 80x42   jnhollma@@/dev/ttyp5      0(m11)    &R.x
1907  (A)   (B)       (C)     (D)     (E)  (F)(G)    (H)(I)
1908 @end example
1910 The legend is as follows:
1911 @*(A) The terminal type known by @code{screen} for this display.
1912 @*(B) Displays geometry as width x height.
1913 @*(C) Username who is logged in at the display.
1914 @*(D) Device name of the display or the attached device
1915 @*(E) Display is in blocking or nonblocking mode. The available
1916     modes are "nb", "NB", "Z<", "Z>", and  "BL".
1917 @*(F) Number of the window
1918 @*(G) Name/title of window
1919 @*(H) Whether the window is shared
1920 @*(I) Window permissions. Made up of three characters:
1921 @display
1922 (1st character)
1923     @samp{-} : no read
1924     @samp{r} : read
1925     @samp{R} : read only due to foreign wlock
1926 (2nd character)
1927     @samp{-} : no write
1928     @samp{.} : write suppressed by foreign wlock
1929     @samp{w} : write
1930     @samp{W} : own wlock
1931 (3rd character)
1932     @samp{-} : no execute
1933     @samp{x} : execute
1934 @end display
1936 @code{Displays} needs a region size of at least 10 characters
1937 wide and 5 characters high in order to display.
1938 @end deffn
1940 @node Umask, Wall, Displays, Multiuser Session
1941 @subsection aclumask
1942 @deffn Command aclumask [@var{users}]+/-@var{bits} ...
1943 @deffnx Command umask [@var{users}]+/-@var{bits} ...
1944 (none)@*
1945 This specifies the access other users have to  windows  that
1946 will  be  created  by  the caller of the command. @var{Users} may be no,
1947 one or a comma separated list of known usernames.  If  no  users  are
1948 specified,  a  list of all currently known users is assumed.
1949 @var{Bits} is any  combination  of  access  control  bits  allowed
1950 defined  with the @code{aclchg} command. The special username @samp{?}
1951 predefines the access that  not  yet  known  users  will  be
1952 granted  to any window initially.  The special username @samp{??}
1953 predefines the access that not yet known users  are  granted
1954 to any command. Rights of the special username nobody cannot
1955 be changed (see the @code{su} command).
1956 @code{Umask} is a synonym to @code{aclumask}.
1957 @end deffn
1960 @node Wall, Writelock, Umask, Multiuser Session
1961 @subsection Wall
1962 @deffn Command wall @var{message}
1963 (none)@*
1964 Write a message to all displays. The message will appear in the terminal's
1965 status line.
1966 @end deffn
1968 @node Writelock, Su , Wall, Multiuser Session
1969 @subsection Writelock
1970 @deffn Command writelock @var{on|off|auto}
1971 (none)@*
1972 In addition to access control lists, not all users may be able to write to
1973 the same window at once. Per default, writelock is in @samp{auto} mode and
1974 grants exclusive input permission to the user who is the first to switch
1975 to the particular window. When he leaves the window, other users may obtain
1976 the writelock (automatically). The writelock of the current window is disabled
1977 by the command @code{writelock off}. If the user issues the command
1978 @code{writelock on} he keeps the exclusive write permission while switching
1979 to other windows.
1980 @end deffn
1982 @deffn Command defwritelock @var{on|off|auto}
1983 (none)@*
1984 Sets the default writelock behavior for new windows. Initially all windows
1985 will be created with no writelocks.
1986 @end deffn
1988 @node Su,  , Writelock, Multiuser Session
1989 @subsection Su
1990 @deffn Command su [@var{username} [@var{password} [@var{password2}]]]
1991 (none)@*
1992 Substitute the user of a display. The  command  prompts  for
1993 all parameters that are omitted. If passwords are specified
1994 as parameters, they have  to  be  specified  un-crypted.  The
1995 first  password  is matched against the systems passwd database,
1996 the second password  is  matched  against  the @code{screen}
1997 password  as  set  with the commands @code{acladd} or @code{password}.
1998 @code{Su} may be useful for the @code{screen} administrator to test
1999 multiuser  setups.
2000 When  the  identification  fails,  the  user has
2001 access to the commands available for user @samp{nobody}. These are
2002 @code{detach}, @code{license}, @code{version}, @code{help} and
2003 @code{displays}.
2004 @end deffn
2006 @node Session Name, Suspend, Multiuser Session, Session Management
2007 @section Session Name
2008 @deffn Command sessionname [@var{name}]
2009 (none)@*
2010 Rename the current session. Note that for @code{screen -list} the name
2011 shows up with the process-id prepended. If the argument @var{name} is
2012 omitted, the name of this session is displayed.@*
2013 @emph{Caution}: The @code{$STY}
2014 environment variable will still reflect the old name in pre-existing
2015 shells. This may result in
2016 confusion.  Use of this command is generally
2017 discouraged. Use the @code{-S} command-line option if you want to
2018 name a new session.The default is constructed from the tty and host names.
2019 @end deffn
2021 @node Suspend, Quit, Session Name, Session Management
2022 @section Suspend
2023 @kindex z
2024 @kindex C-z
2025 @deffn Command suspend
2026 (@kbd{C-a z}, @kbd{C-a C-z})@*
2027 Suspend @code{screen}.  The windows are in the detached state while
2028 @code{screen} is suspended.  This feature relies on the parent shell
2029 being able to do job control.
2030 @end deffn
2032 @node Quit,  , Suspend, Session Management
2033 @section Quit
2034 @kindex C-\
2035 @deffn Command quit
2036 (@kbd{C-a C-\})@*
2037 Kill all windows and terminate @code{screen}.  Note that on VT100-style
2038 terminals the keys @kbd{C-4} and @kbd{C-\} are identical.  So be careful
2039 not to type @kbd{C-a C-4} when selecting window no. 4.  Use the empty
2040 bind command (as in @code{bind "^\"}) to remove a key binding
2041 (@pxref{Key Binding}).
2042 @end deffn
2044 @node Regions, Window Settings, Session Management, Top
2045 @chapter Regions
2046 @cindex regions
2047 Screen has the ability to display more than one window on the
2048 user's display. This is done by splitting the screen in regions,
2049 which can contain different windows.
2051 @menu
2052 * Split::                       Split a region into two
2053 * Focus::                       Change to the next region
2054 * Only::                        Delete all other regions
2055 * Remove::                      Delete the current region
2056 * Resize::                      Grow or shrink a region
2057 * Caption::                     Control the window's caption
2058 * Fit::                         Resize a window to fit the region
2059 * Focusminsize::                Force a minimum size on a current region
2060 * Layout::                      Manage groups of regions
2061 @end menu
2063 @node Split, Focus,  , Regions
2064 @section Split
2065 @kindex S
2066 @kindex |
2067 @deffn Command split [-v]
2068 (@kbd{C-a S}, @kbd{C-a |})@*
2069 Split the current region into two new ones. All regions on the
2070 display are resized to make room for the new region. The blank
2071 window is displayed on the new region. The default is to create
2072 a horizontal split, putting the new regions on the top and
2073 bottom of each other. Using -v will create a vertical split,
2074 causing the new regions to appear side by side of each other.
2076 With this current implementation of @code{screen}, scrolling data
2077 will appear much slower in a vertically split region than one
2078 that is not. This should be taken into consideration if you need
2079 to use system commands such as @code{cat} or @code{tail -f}.
2080 @end deffn
2082 @node Focus, Only, Split, Regions
2083 @section Focus
2084 @kindex TAB
2085 @deffn Command focus
2086 (@kbd{C-a @key{Tab}})@*
2087 Move the input focus to the next region. This is done in a cyclic
2088 way so that the top region is selected after the bottom one. If
2089 no subcommand is given it defaults to `down'. `up' cycles in the
2090 opposite order, `top' and `bottom' go to the top and bottom
2091 region respectively. Useful bindings are (j and k as in vi)
2092 @example
2093 bind j focus down
2094 bind k focus up
2095 bind t focus top
2096 bind b focus bottom
2097 @end example
2098 @end deffn
2100 @node Only, Remove, Focus, Regions
2101 @section Only
2102 @kindex Q
2103 @deffn Command only
2104 (@kbd{C-a Q})@*
2105 Kill all regions but the current one.
2106 @end deffn
2108 @node Remove, Resize, Only, Regions
2109 @section Remove
2110 @kindex X
2111 @deffn Command remove
2112 (@kbd{C-a X})@*
2113 Kill the current region. This is a no-op if there is only one region.
2114 @end deffn
2116 @node Resize, Caption, Remove, Regions
2117 @section Resize
2118 @deffn Command resize [(+/-)@var{lines}]
2119 (none)@*
2120 Resize the current region. The space will be removed from or added to
2121 the region below or if there's not enough space from the region above.
2122 @example
2123 resize +N       increase current region height by N
2124 resize -N       decrease current region height by N
2125 resize  N       set current region height to N
2126 resize  =       make all windows equally high
2127 resize  max     maximize current region height
2128 resize  min     minimize current region height
2129 @end example
2130 @end deffn
2132 @node Caption, Fit, Resize, Regions
2133 @section Caption
2134 @deffn Command caption @code{always}|@code{splitonly} [string]
2135 @deffnx Command caption @code{string} [string]
2136 (none)@*
2137 This command controls the display of the window captions. Normally
2138 a caption is only used if more than one window is shown on the
2139 display (split screen mode). But if the type is set to
2140 @code{always}, @code{screen} shows a caption
2141 even if only one window is displayed. The default
2142 is @samp{splitonly}.
2144 The second form changes the text used for the caption. You can use
2145 all string escapes (@pxref{String Escapes}). @code{Screen} uses
2146 a default of @samp{%3n %t}.
2148 You can mix both forms by providing the string as an additional
2149 argument.
2150 @end deffn
2152 @node Fit, Focusminsize, Caption, Regions
2153 @section Fit
2154 @kindex F
2155 @deffn Command fit
2156 (@kbd{C-a F})@*
2157 Change the window size to the size of the current region. This
2158 command is needed because screen doesn't adapt the window size
2159 automatically if the window is displayed more than once.
2160 @end deffn
2162 @node Focusminsize, Layout, Fit, Regions
2163 @section Focusminsize
2164 @deffn Command focusminsize [ (width|@code{max}|@code{_})  (height|@code{max}|@code{_}) ]
2165 (none)@*
2166 This forces any currently selected region to be automatically
2167 resized at least a certain @var{width} and @var{height}. All
2168 other surrounding regions will be resized in order to accommodate.
2169 This constraint follows every time the @code{focus} command is
2170 used. The @code{resize} command can be used to increase either
2171 dimension of a region, but never below what is set with
2172 @code{focusminsize}. The underscore @samp{_} is a synonym for
2173 @code{max}. Setting a @var{width} and @var{height} of @code{0 0}
2174 (zero zero) will undo any constraints and allow for manual resizing.
2175 Without any parameters, the minimum width and height is shown.
2176 @end deffn
2178 @node Layout, , Focusminsize, Regions
2179 @section Layout
2180 @cindex layout
2181 Using regions, and perhaps a large enough terminal, you can give
2182 @code{screen} more of a desktop feel. By being able to split
2183 regions horizontally or vertically, you can take advantage of the
2184 lesser used spaces of your terminal. The catch to these splits has
2185 been that they're not kept between screen detachments and reattachments.
2187 Layouts will help organize your regions. You can create one
2188 layout of four horizontal regions and then create a separate layout
2189 of regions in a two by two array. The regions could contain the same windows,
2190 but they don't have to. You can easily switch between layouts and keep
2191 them between detachments and reattachments.
2193 Note that there are several subcommands to @code{layout}.
2195 @deffn Command layout @code{new} [title]
2196 (none)@*
2197 Create a new layout. The screen will change to one whole region 
2198 and be switched to the blank window. From here, you build the 
2199 regions and the windows they show as you desire. The new layout 
2200 will be numbered with the smallest available integer, starting 
2201 with zero. You can optionally give a title to your new layout. 
2202 Otherwise, it will have a default title of @code{layout}. You 
2203 can always change the title later by using the command 
2204 @code{layout title}.
2205 @end deffn
2207 @deffn Command layout @code{remove} [n|title]
2208 (none)@*
2209 Remove, or in other words, delete the specified layout. Either
2210 the number or the title can be specified. Without either
2211 specification, @code{screen} will remove the current layout.
2213 Removing a layout does not affect your set windows or regions.
2214 @end deffn
2216 @deffn Command layout @code{next}
2217 (none)@*
2218 Switch to the next layout available
2219 @end deffn
2221 @deffn Command layout @code{prev}
2222 (none)@*
2223 Switch to the previous layout available
2224 @end deffn
2226 @deffn Command layout @code{select} [n|title]
2227 (none)@*
2228 Select the desired layout. Either the number or the title can
2229 be specified. Without either specification, @code{screen} will
2230 prompt and ask which screen is desired. To see which layouts are
2231 available, use the @code{layout show} command.
2232 @end deffn
2234 @deffn Command layout @code{show}
2235 (none)@*
2236 List on the message line the number(s) and title(s) of the available
2237 layout(s). The current layout is flagged.
2238 @end deffn
2240 @deffn Command layout @code{title} [title]
2241 (none)@*
2242 Change or display the title of the current layout. A string given
2243 will be used to name the layout. Without any options, the current
2244 title and number is displayed on the message line.
2245 @end deffn
2247 @deffn Command layout @code{number} [n]
2248 (none)@*
2249 Change or display the number of the current layout. An integer given
2250 will be used to number the layout. Without any options, the current
2251 number and title is displayed on the message line.
2252 @end deffn
2254 @deffn Command layout @code{attach} [title|@code{:last}]
2255 (none)@*
2256 Change or display which layout to reattach back to. The default is
2257 @code{:last}, which tells @code{screen} to reattach back to the last
2258 used layout just before detachment. By supplying a title, You can
2259 instruct @code{screen} to reattach to a particular layout regardless
2260 which one was used at the time of detachment. Without any options,
2261 the layout to reattach to will be shown in the message line.
2262 @end deffn
2264 @deffn Command layout @code{save} [n|title]
2265 (none)@*
2266 Remember the current arrangement of regions. When used, @code{screen}
2267 will remember the arrangement of vertically and horizontally split
2268 regions. This arrangement is restored when a @code{screen} session
2269 is reattached or switched back from a different layout. If the
2270 session ends or the @code{screen} process dies, the layout
2271 arrangements are lost. The @code{layout dump} command should help
2272 in this siutation. If a number
2273 or title is supplied, @code{screen} will remember the arrangement of
2274 that particular layout. Without any options, @code{screen} will
2275 remember the current layout.
2277 Saving your regions can be done automatically by using the
2278 @code{layout autosave} command.
2279 @end deffn
2281 @deffn Command layout @code{autosave} [@code{on}|@code{off}]
2282 (none)@*
2283 Change or display the status of automatically saving layouts. The
2284 default is @code{on}, meaning when @code{screen} is detached or
2285 changed to a different layout, the arrangement of regions and windows
2286 will be remembered at the time of change and restored upon return.
2287 If autosave is set to @code{off}, that arrangement will only be
2288 restored to either to the last manual save, using @code{layout save},
2289 or to when the layout was first created, to a single region with
2290 a single window. Without either an @code{on} or an @code{off}, the
2291 current status is displayed on the message line.
2292 @end deffn
2294 @deffn Command layout @code{dump} [filename]
2295 (none)@*
2296 Write to a file the order of splits made in the current layout. This
2297 is useful to recreate the order of your regions used in your current
2298 layout. Only the current layout is recorded. While the order of the
2299 regions are recorded, the sizes of those regions and which windows
2300 correspond to which regions are not. If no filename is specified,
2301 the default is @file{layout-dump}, saved in the directory that the
2302 @code{screen} process was started in. If the file already exists,
2303 @code{layout dump} will append to that file. As an example:
2304 @example
2305 layout dump /home/user/.screenrc
2306 @end example
2307 will save or append the layout to the user's @file{.screenrc} file.
2308 @end deffn
2310 @node Window Settings, Virtual Terminal, Regions, Top
2311 @chapter Window Settings
2313 These commands control the way @code{screen} treats individual windows
2314 in a session.  @xref{Virtual Terminal}, for commands to control the
2315 terminal emulation itself.
2317 @menu
2318 * Naming Windows::              Control the name of the window
2319 * Console::                     See the host's console messages
2320 * Kill::                        Destroy an unwanted window
2321 * Login::                       Control @file{/etc/utmp} logging
2322 * Mode::                        Control the file mode of the pty
2323 * Monitor::                     Watch for activity or inactivity in a window
2324 * Windows::                     List the active windows
2325 * Hardstatus::                  Set a window's hardstatus line
2326 @end menu
2328 @node Naming Windows, Console,  , Window Settings
2329 @section Naming Windows (Titles)
2330 @cindex title
2332 You can customize each window's name in the window display (viewed with
2333 the @code{windows} command (@pxref{Windows}) by setting it with
2334 one of the title commands.  Normally the name displayed is the actual
2335 command name of the program created in the window.  However, it is
2336 sometimes useful to distinguish various programs of the same name or to
2337 change the name on-the-fly to reflect the current state of the window.
2339 The default name for all shell windows can be set with the
2340 @code{shelltitle} command (@pxref{Shell}).  You can specify the name you
2341 want for a window with the @samp{-t} option to the @code{screen} command
2342 when the window is created (@pxref{Screen Command}).  To change the name after
2343 the window has been created you can use the title-string escape-sequence
2344 (@kbd{@key{ESC} k @var{name} @key{ESC} \}) and the @code{title} command
2345 (C-a A).  The former can be output from an application to control the
2346 window's name under software control, and the latter will prompt for a
2347 name when typed.  You can also bind predefined names to keys with the
2348 @code{title} command to set things quickly without prompting.
2350 @menu
2351 * Title Command::                 The @code{title} command.
2352 * Dynamic Titles::                Make shell windows change titles dynamically.
2353 * Title Prompts::                 Set up your shell prompt for dynamic Titles.
2354 * Title Screenrc::                Set up Titles in your @file{.screenrc}.
2355 @end menu
2357 @node Title Command, Dynamic Titles,  , Naming Windows
2358 @subsection Title Command
2359 @kindex A
2360 @deffn Command title [windowtitle]
2361 (@kbd{C-a A})@*
2362 Set the name of the current window to @var{windowtitle}. If no name is 
2363 specified, screen prompts for one.
2364 @end deffn
2366 @node Dynamic Titles, Title Prompts, Title Command, Naming Windows
2367 @subsection Dynamic Titles
2368 @code{screen} has a shell-specific heuristic that is enabled by
2369 setting the window's name to @var{search|name} and arranging to have a
2370 null title escape-sequence output as a part of your prompt.  The
2371 @var{search} portion specifies an end-of-prompt search string, while the
2372 @var{name} portion specifies the default shell name for the window.  If
2373 the @var{name} ends in a @samp{:} @code{screen} will add what it
2374 believes to be the current command running in the window to the end of
2375 the specified name (e.g. @var{name:cmd}).  Otherwise the current
2376 command name supersedes the shell name while it is running.
2378 Here's how it works: you must modify your shell prompt to output a null
2379 title-escape-sequence (@key{ESC} k @key{ESC} \) as a part of your prompt.
2380 The last part of your prompt must be the same as the string you
2381 specified for the @var{search} portion of the title.  Once this is set
2382 up, @code{screen} will use the title-escape-sequence to clear the previous
2383 command name and get ready for the next command.  Then, when a newline
2384 is received from the shell, a search is made for the end of the prompt.
2385 If found, it will grab the first word after the matched string and use
2386 it as the command name.  If the command name begins with @samp{!},
2387 @samp{%}, or @samp{^}, @code{screen} will use the first word on the
2388 following line (if found) in preference to the just-found name.  This
2389 helps csh users get more accurate titles when using job control or
2390 history recall commands.
2392 @node Title Prompts, Title Screenrc, Dynamic Titles, Naming Windows
2393 @subsection Setting up your prompt for shell titles
2394 One thing to keep in mind when adding a null title-escape-sequence to your
2395 prompt is that some shells (like the csh) count all the non-control
2396 characters as part of the prompt's length.  If these invisible
2397 characters aren't a multiple of 8 then backspacing over a tab will
2398 result in an incorrect display.  One way to get around this is to use a
2399 prompt like this:
2401 @example
2402 set prompt='@value{esc}[0000m@value{esc}k@value{esc}\% '
2403 @end example
2405 The escape-sequence @samp{@value{esc}[0000m} not only normalizes the
2406 character attributes, but all the zeros round the length of the
2407 invisible characters up to 8.
2409 Tcsh handles escape codes in the prompt more intelligently, so you can
2410 specify your prompt like this:
2412 @example
2413 set prompt="%@{\ek\e\\%@}\% "
2414 @end example
2416 Bash users will probably want to echo the escape sequence in the
2417 PROMPT_COMMAND:
2419 @example
2420 PROMPT_COMMAND='printf "\033k\033\134"'
2421 @end example
2423 (I used @samp{\134} to output a @samp{\} because of a bug in v1.04).
2425 @node Title Screenrc,  , Title Prompts, Naming Windows
2426 @subsection Setting up shell titles in your @file{.screenrc}
2427 Here are some .screenrc examples:
2429 @example
2430 screen -t top 2 nice top
2431 @end example
2433 Adding this line to your .screenrc would start a niced version of the
2434 @code{top} command in window 2 named @samp{top} rather than @samp{nice}.
2436 @example
2437 shelltitle '> |csh'
2438 screen 1
2439 @end example
2441 This file would start a shell using the given shelltitle.  The title
2442 specified is an auto-title that would expect the prompt and the typed
2443 command to look something like the following:
2445 @example
2446 /usr/joe/src/dir> trn
2447 @end example
2449 (it looks after the '> ' for the command name).
2450 The window status would show the name @samp{trn} while the command was
2451 running, and revert to @samp{csh} upon completion.
2453 @example
2454 bind R screen -t '% |root:' su
2455 @end example
2457 Having this command in your .screenrc would bind the key sequence
2458 @kbd{C-a R} to the @code{su} command and give it an auto-title name of
2459 @samp{root:}.  For this auto-title to work, the screen could look
2460 something like this:
2462 @example
2463 % !em
2464 emacs file.c
2465 @end example
2467 Here the user typed the csh history command @code{!em} which ran the
2468 previously entered @code{emacs} command.  The window status would show
2469 @samp{root:emacs} during the execution of the command, and revert to
2470 simply @samp{root:} at its completion.
2472 @example
2473 bind o title
2474 bind E title ""
2475 bind u title (unknown)
2476 @end example
2478 The first binding doesn't have any arguments, so it would prompt you for
2479 a title when you type @kbd{C-a o}.  The second binding would clear an
2480 auto-titles current setting (C-a E).  The third binding would set the
2481 current window's title to @samp{(unknown)} (C-a u).
2483 @node Console, Kill, Naming Windows, Window Settings
2484 @section Console
2485 @deffn Command console [@var{state}]
2486 (none)@*
2487 Grabs or un-grabs the machines console output to a window. When the argument
2488 is omitted the current state is displayed.
2489 @emph{Note}: Only the owner of @file{/dev/console} can grab the console
2490 output. This command is only available if the host supports the ioctl
2491 @code{TIOCCONS}.
2492 @end deffn
2494 @node Kill, Login, Console, Window Settings
2495 @section Kill
2497 @kindex k
2498 @kindex C-k
2499 @deffn Command kill
2500 (@kbd{C-a k}, @kbd{C-a C-k})@*
2501 Kill the current window.@*
2502 If there is an @code{exec} command running (@pxref{Exec}) then it is killed.
2503 Otherwise the process (e.g. shell) running in the window receives a 
2504 @code{HANGUP} condition, 
2505 the window structure is removed and screen (your display) switches to another
2506 window. When the last window is destroyed, @code{screen} exits.
2507 After a kill screen switches to the previously displayed window.
2508 @* 
2509 @emph{Caution}: @code{emacs} users may find themselves killing their
2510 @code{emacs} session when trying to delete the current line.  For this
2511 reason, it is probably wise to use a different command character
2512 (@pxref{Command Character}) or rebind @code{kill} to another key
2513 sequence, such as @kbd{C-a K} (@pxref{Key Binding}).
2514 @end deffn
2516 @node Login, Mode, Kill, Window Settings
2517 @section Login
2519 @deffn Command deflogin state
2520 (none)@*
2521 Same as the @code{login} command except that the default setting for new
2522 windows is changed.  This defaults to `on' unless otherwise specified at
2523 compile time (@pxref{Installation}). Both commands are only present when
2524 @code{screen} has been compiled with utmp support.
2525 @end deffn
2527 @kindex L
2528 @deffn Command login [state]
2529 (@kbd{C-a L})@*
2530 Adds or removes the entry in @file{/etc/utmp} for the current window.
2531 This controls whether or not the window is @dfn{logged in}.  In addition
2532 to this toggle, it is convenient to have ``log in'' and ``log out''
2533 keys.  For instance, @code{bind I login on} and @code{bind O 
2534 login off} will map these keys to be @kbd{C-a I} and @kbd{C-a O}
2535 (@pxref{Key Binding}).
2536 @end deffn
2538 @node Mode, Monitor, Login, Window Settings
2539 @section Mode
2540 @deffn Command defmode mode
2541 (none)@*
2542 The mode of each newly allocated pseudo-tty is set to @var{mode}.
2543 @var{mode} is an octal number as used by chmod(1).  Defaults to 0622 for
2544 windows which are logged in, 0600 for others (e.g. when @code{-ln} was 
2545 specified for creation, @pxref{Screen Command}).
2546 @end deffn
2548 @node Monitor, Windows, Mode, Window Settings
2549 @section Monitoring
2551 @deffn Command activity message
2552 (none)@*
2553 When any activity occurs in a background window that is being monitored,
2554 @code{screen} displays a notification in the message line.  The
2555 notification message can be redefined by means of the @code{activity}
2556 command.  Each occurrence of @samp{%} in @var{message} is replaced by
2557 the number of the window in which activity has occurred, and each
2558 occurrence of @samp{^G} is replaced by the definition for bell in your
2559 termcap (usually an audible bell).  The default message is
2561 @example
2562 'Activity in window %n'
2563 @end example
2565 Note that monitoring is off for all windows by default, but can be altered
2566 by use of the @code{monitor} command (@kbd{C-a M}).
2567 @end deffn
2569 @deffn Command defmonitor state
2570 (none)@*
2571 Same as the @code{monitor} command except that the default setting for
2572 new windows is changed.  Initial setting is `off'.
2573 @end deffn
2575 @kindex M
2576 @deffn Command monitor [state]
2577 (@kbd{C-a M})@*
2578 Toggles monitoring of the current window.  When monitoring is turned on
2579 and the affected window is switched into the background, the activity
2580 notification message will be displayed in the status line at the first
2581 sign of output, and the window will also be marked with an @samp{@@} in
2582 the window-status display (@pxref{Windows}).  Monitoring defaults to
2583 @samp{off} for all windows.
2584 @end deffn
2586 @kindex _
2587 @deffn Command silence [@var{state}|@var{sec}]
2588 (@kbd{C-a _})@*
2589 Toggles silence monitoring of windows. When silence is turned on and an 
2590 affected window is switched into the background, you will receive the
2591 silence notification message in the status line after a specified period
2592 of inactivity (silence). The default timeout can be changed with the
2593 @code{silencewait} command or by specifying a number of seconds instead of
2594 @code{on} or @code{off}. Silence is initially off for all windows.
2595 @end deffn
2597 @deffn Command defsilence state
2598 (none)@*
2599 Same as the @code{silence} command except that the default setting for
2600 new windows is changed.  Initial setting is `off'.
2601 @end deffn
2603 @deffn Command silencewait @var{seconds}
2604 (none)@*
2605 Define the time that all windows monitored for silence should wait
2606 before displaying a message. Default is 30 seconds.
2607 @end deffn
2609 @node Windows, Hardstatus, Monitor, Window Settings
2610 @section Windows
2611 @kindex w
2612 @kindex C-w
2613 @deffn Command windows
2614 (@kbd{C-a w}, @kbd{C-a C-w})@*
2615 Uses the message line to display a list of all the windows.  Each
2616 window is listed by number with the name of the program running in the
2617 window (or its title). 
2619 The current window is marked with a @samp{*};
2620 the previous window is marked with a @samp{-}; 
2621 all the windows that are logged in are marked with a @samp{$} (@pxref{Login});
2622 a background window that has received a bell is marked with a @samp{!};
2623 a background window that is being monitored and has had activity occur is 
2624 marked with an @samp{@@} (@pxref{Monitor});
2625 a window which has output logging turned on is marked with @samp{(L)};
2626 windows occupied by other users are marked with @samp{&}
2627 or @samp{&&} if the window is shared by other users;
2628 windows in the zombie state are marked with @samp{Z}. 
2630 If this list is too long to fit on the terminal's status line only the
2631 portion around the current window is displayed.
2632 @end deffn
2634 @node Hardstatus, Mousetrack, Windows, Window Settings
2635 @section Hardstatus
2637 @code{Screen} maintains a hardstatus line for every window. If a window
2638 gets selected, the display's hardstatus will be updated to match
2639 the window's hardstatus line.
2640 The hardstatus line can be changed with the ANSI Application
2641 Program Command (APC): @samp{ESC_<string>ESC\}. As a convenience
2642 for xterm users the sequence @samp{ESC]0..2;<string>^G} is
2643 also accepted.
2645 @deffn Command defhstatus [status]
2646 (none)@*
2647 The hardstatus line that all new windows will get is set to
2648 @var{status}.
2649 This command is useful to make the hardstatus of every window
2650 display the window number or title or the like.  @var{status}
2651 may contain the same directives as in the window messages, but
2652 the directive escape character is @samp{^E} (octal 005) instead
2653 of @samp{%}.  This was done to make a misinterpretation of program
2654 generated hardstatus lines impossible.
2655 If the parameter @var{status}
2656 is omitted, the current default string is displayed.
2657 Per default the hardstatus line of new windows is empty.
2658 @end deffn
2660 @deffn Command hstatus status
2661 (none)@*
2662 Changes the current window's hardstatus line to @var{status}.
2663 @end deffn
2665 @node Mousetrack, , Hardstatus, Miscellaneous
2666 @section Mousetrack
2668 @deffn Command mousetrack [ @code{on|off} ]
2669 (none)@*
2670 This command determines whether @code{screen} will watch for
2671 mouse clicks. When this command is enabled, regions that have
2672 been split in various ways can be selected by pointing to them
2673 with a mouse and left-clicking them. Without specifying @var{on}
2674 or @var{off}, the current state is displayed. The default state
2675 is determined by the @code{defmousetrack} command.
2676 @end deffn
2678 @deffn Command defmousetrack @code{on|off} 
2679 (none)@*
2680 This command determines the default state of the @code{mousetrack}
2681 command, currently defaulting of @var{off}.
2682 @end deffn
2684 @node Virtual Terminal, Copy and Paste, Window Settings, Top
2685 @chapter Virtual Terminal
2687 Each window in a @code{screen} session emulates a VT100 terminal, with
2688 some extra functions added. The VT100 emulator is hard-coded, no other
2689 terminal types can be emulated. 
2690 The commands described here modify the terminal emulation.
2692 @menu
2693 * Control Sequences::           Details of the internal VT100 emulation.
2694 * Input Translation::           How keystrokes are remapped.
2695 * Digraph::                     Entering digraph sequences.
2696 * Bell::                        Getting your attention.
2697 * Clear::                       Clear the window display.
2698 * Info::                        Terminal emulation statistics.
2699 * Redisplay::                   When the display gets confusing.
2700 * Wrap::                        Automatic margins.
2701 * Reset::                       Recovering from ill-behaved applications.
2702 * Window Size::                 Changing the size of your terminal.
2703 * Character Processing::        Change the effect of special characters.
2704 @end menu
2706 @node Control Sequences, Input Translation,  , Virtual Terminal
2707 @section Control Sequences
2708 @cindex control sequences
2709 The following is a list of control sequences recognized by
2710 @code{screen}.  @samp{(V)} and @samp{(A)} indicate VT100-specific and
2711 ANSI- or ISO-specific functions, respectively.
2713 @example
2714 ESC E                           Next Line
2715 ESC D                           Index
2716 ESC M                           Reverse Index
2717 ESC H                           Horizontal Tab Set
2718 ESC Z                           Send VT100 Identification String
2719 ESC 7                   (V)     Save Cursor and Attributes
2720 ESC 8                   (V)     Restore Cursor and Attributes
2721 ESC [s                  (A)     Save Cursor and Attributes
2722 ESC [u                  (A)     Restore Cursor and Attributes
2723 ESC c                           Reset to Initial State
2724 ESC g                           Visual Bell
2725 ESC Pn p                        Cursor Visibility (97801)
2726     Pn = 6                      Invisible
2727          7                      Visible
2728 ESC =                   (V)     Application Keypad Mode
2729 ESC >                   (V)     Numeric Keypad Mode
2730 ESC # 8                 (V)     Fill Screen with E's
2731 ESC \                   (A)     String Terminator
2732 ESC ^                   (A)     Privacy Message String (Message Line)
2733 ESC !                           Global Message String (Message Line)
2734 ESC k                           Title Definition String
2735 ESC P                   (A)     Device Control String
2736                                 Outputs a string directly to the host
2737                                 terminal without interpretation.
2738 ESC _                   (A)     Application Program Command (Hardstatus)
2739 ESC ] 0 ; string ^G     (A)     Operating System Command (Hardstatus, xterm
2740                                 title hack)
2741 ESC ] 83 ; cmd ^G       (A)     Execute screen command. This only works if
2742                                 multi-user support is compiled into screen.
2743                                 The pseudo-user ":window:" is used to check
2744                                 the access control list. Use "addacl :window:
2745                                 -rwx #?" to create a user with no rights and
2746                                 allow only the needed commands.
2747 Control-N               (A)     Lock Shift G1 (SO)
2748 Control-O               (A)     Lock Shift G0 (SI)
2749 ESC n                   (A)     Lock Shift G2
2750 ESC o                   (A)     Lock Shift G3
2751 ESC N                   (A)     Single Shift G2
2752 ESC O                   (A)     Single Shift G3
2753 ESC ( Pcs               (A)     Designate character set as G0
2754 ESC ) Pcs               (A)     Designate character set as G1
2755 ESC * Pcs               (A)     Designate character set as G2
2756 ESC + Pcs               (A)     Designate character set as G3
2757 ESC [ Pn ; Pn H                 Direct Cursor Addressing
2758 ESC [ Pn ; Pn f                 same as above
2759 ESC [ Pn J                      Erase in Display
2760       Pn = None or 0            From Cursor to End of Screen
2761            1                    From Beginning of Screen to Cursor
2762            2                    Entire Screen
2763 ESC [ Pn K                      Erase in Line
2764       Pn = None or 0            From Cursor to End of Line
2765            1                    From Beginning of Line to Cursor
2766            2                    Entire Line
2767 ESC [ Pn X                      Erase character
2768 ESC [ Pn A                      Cursor Up
2769 ESC [ Pn B                      Cursor Down
2770 ESC [ Pn C                      Cursor Right
2771 ESC [ Pn D                      Cursor Left
2772 ESC [ Pn E                      Cursor next line
2773 ESC [ Pn F                      Cursor previous line
2774 ESC [ Pn G                      Cursor horizontal position
2775 ESC [ Pn `                      same as above
2776 ESC [ Pn d                      Cursor vertical position
2777 ESC [ Ps ;...; Ps m             Select Graphic Rendition
2778       Ps = None or 0            Default Rendition
2779            1                    Bold
2780            2            (A)     Faint
2781            3            (A)     @i{Standout} Mode (ANSI: Italicized)
2782            4                    Underlined
2783            5                    Blinking
2784            7                    Negative Image
2785            22           (A)     Normal Intensity
2786            23           (A)     @i{Standout} Mode off (ANSI: Italicized off)
2787            24           (A)     Not Underlined
2788            25           (A)     Not Blinking
2789            27           (A)     Positive Image
2790            30           (A)     Foreground Black
2791            31           (A)     Foreground Red
2792            32           (A)     Foreground Green
2793            33           (A)     Foreground Yellow
2794            34           (A)     Foreground Blue
2795            35           (A)     Foreground Magenta
2796            36           (A)     Foreground Cyan
2797            37           (A)     Foreground White
2798            39           (A)     Foreground Default
2799            40           (A)     Background Black
2800            ...                  ...
2801            49           (A)     Background Default
2802 ESC [ Pn g                      Tab Clear
2803       Pn = None or 0            Clear Tab at Current Position
2804            3                    Clear All Tabs
2805 ESC [ Pn ; Pn r         (V)     Set Scrolling Region
2806 ESC [ Pn I              (A)     Horizontal Tab
2807 ESC [ Pn Z              (A)     Backward Tab
2808 ESC [ Pn L              (A)     Insert Line
2809 ESC [ Pn M              (A)     Delete Line
2810 ESC [ Pn @@              (A)     Insert Character
2811 ESC [ Pn P              (A)     Delete Character
2812 ESC [ Pn S                      Scroll Scrolling Region Up
2813 ESC [ Pn T                      Scroll Scrolling Region Down
2814 ESC [ Pn ^                      same as above
2815 ESC [ Ps ;...; Ps h             Set Mode
2816 ESC [ Ps ;...; Ps l             Reset Mode
2817       Ps = 4            (A)     Insert Mode
2818            20           (A)     @samp{Automatic Linefeed} Mode.
2819            34                   Normal Cursor Visibility
2820            ?1           (V)     Application Cursor Keys
2821            ?3           (V)     Change Terminal Width to 132 columns
2822            ?5           (V)     Reverse Video
2823            ?6           (V)     @samp{Origin} Mode
2824            ?7           (V)     @samp{Wrap} Mode
2825            ?9                   X10 mouse tracking
2826            ?25          (V)     Visible Cursor
2827            ?47                  Alternate Screen (old xterm code)
2828            ?1000        (V)     VT200 mouse tracking
2829            ?1047                Alternate Screen (new xterm code)
2830            ?1049                Alternate Screen (new xterm code)
2831 ESC [ 5 i               (A)     Start relay to printer (ANSI Media Copy)
2832 ESC [ 4 i               (A)     Stop relay to printer (ANSI Media Copy)
2833 ESC [ 8 ; Ph ; Pw t             Resize the window to @samp{Ph} lines and
2834                                 @samp{Pw} columns (SunView special)
2835 ESC [ c                         Send VT100 Identification String
2836 ESC [ x                 (V)     Send Terminal Parameter Report
2837 ESC [ > c                       Send Secondary Device Attributes String
2838 ESC [ 6 n                       Send Cursor Position Report
2840 @end example
2843 @node Input Translation, Digraph, Control Sequences, Virtual Terminal
2844 @section Input Translation
2845 @cindex input translation
2846 In order to do a full VT100 emulation @code{screen} has to detect
2847 that a sequence of characters in the input stream was generated
2848 by a keypress on the user's keyboard and insert the VT100
2849 style escape sequence. @code{Screen} has a very flexible way of doing
2850 this by making it possible to map arbitrary commands on arbitrary
2851 sequences of characters. For standard VT100 emulation the command
2852 will always insert a string in the input buffer of the window
2853 (see also command @code{stuff}, @pxref{Paste}).
2854 Because the sequences generated by a keypress can
2855 change after a reattach from a different terminal type, it is
2856 possible to bind commands to the termcap name of the keys.
2857 @code{Screen} will insert the correct binding after each
2858 reattach. See @ref{Bindkey} for further details on the syntax and examples.
2860 Here is the table of the default key bindings. (A) means that the
2861 command is executed if the keyboard is switched into application
2862 mode.
2863 @example
2865 Key name        Termcap name    Command
2866 -----------------------------------------------------
2867 Cursor up            ku         stuff \033[A
2868                                 stuff \033OA      (A)
2869 Cursor down          kd         stuff \033[B
2870                                 stuff \033OB      (A)
2871 Cursor right         kr         stuff \033[C
2872                                 stuff \033OC      (A)
2873 Cursor left          kl         stuff \033[D
2874                                 stuff \033OD      (A)
2875 Function key 0       k0         stuff \033[10~
2876 Function key 1       k1         stuff \033OP
2877 Function key 2       k2         stuff \033OQ
2878 Function key 3       k3         stuff \033OR
2879 Function key 4       k4         stuff \033OS
2880 Function key 5       k5         stuff \033[15~
2881 Function key 6       k6         stuff \033[17~
2882 Function key 7       k7         stuff \033[18~
2883 Function key 8       k8         stuff \033[19~
2884 Function key 9       k9         stuff \033[20~
2885 Function key 10      k;         stuff \033[21~
2886 Function key 11      F1         stuff \033[23~
2887 Function key 12      F2         stuff \033[24~
2888 Home                 kh         stuff \033[1~
2889 End                  kH         stuff \033[4~
2890 Insert               kI         stuff \033[2~
2891 Delete               kD         stuff \033[3~
2892 Page up              kP         stuff \033[5~
2893 Page down            kN         stuff \033[6~
2894 Keypad 0             f0         stuff 0
2895                                 stuff \033Op      (A)
2896 Keypad 1             f1         stuff 1
2897                                 stuff \033Oq      (A)
2898 Keypad 2             f2         stuff 2
2899                                 stuff \033Or      (A)
2900 Keypad 3             f3         stuff 3
2901                                 stuff \033Os      (A)
2902 Keypad 4             f4         stuff 4
2903                                 stuff \033Ot      (A)
2904 Keypad 5             f5         stuff 5
2905                                 stuff \033Ou      (A)
2906 Keypad 6             f6         stuff 6
2907                                 stuff \033Ov      (A)
2908 Keypad 7             f7         stuff 7
2909                                 stuff \033Ow      (A)
2910 Keypad 8             f8         stuff 8
2911                                 stuff \033Ox      (A)
2912 Keypad 9             f9         stuff 9
2913                                 stuff \033Oy      (A)
2914 Keypad +             f+         stuff +
2915                                 stuff \033Ok      (A)
2916 Keypad -             f-         stuff -
2917                                 stuff \033Om      (A)
2918 Keypad *             f*         stuff *
2919                                 stuff \033Oj      (A)
2920 Keypad /             f/         stuff /
2921                                 stuff \033Oo      (A)
2922 Keypad =             fq         stuff =
2923                                 stuff \033OX      (A)
2924 Keypad .             f.         stuff .
2925                                 stuff \033On      (A)
2926 Keypad ,             f,         stuff ,
2927                                 stuff \033Ol      (A)
2928 Keypad enter         fe         stuff \015
2929                                 stuff \033OM      (A)
2930 @end example
2932 @node Digraph, Bell, Input Translation, Virtual Terminal
2933 @section Digraph
2935 @kindex C-v
2936 @deffn Command digraph [preset [unicode-value]] 
2937 (@kbd{C-a C-v})@*
2938 This command prompts the user for a digraph sequence. The next
2939 two characters typed are looked up in a builtin table and the
2940 resulting character is inserted in the input stream. For example,
2941 if the user enters @samp{a"}, an a-umlaut will be inserted. If the
2942 first character entered is a 0 (zero), @code{screen}
2943 will treat the following characters (up to three) as an octal
2944 number instead.  The optional argument @var{preset}
2945 is treated as user input, thus one can create an "umlaut" key.
2946 For example the command @samp{bindkey ^K digraph '"'} enables the user
2947 to generate an a-umlaut by typing @samp{CTRL-K a}. When a non-zero
2948 @var{unicode-value} is specified, a new  digraph  is  created with the
2949 specified preset. The digraph is unset if a zero value is provided
2950 for the @var{unicode-value}.
2952 The following table is the builtin sequences.
2954 @documentencoding ISO-8859-1
2955 @example
2956      Sequence   Octal   Digraph   Unicode Equivalent
2957      -----------------------------------------------
2958      ' ', ' '    160    (space)         U+00A0
2959      'N', 'S'    160    (space)         U+00A0
2960      '~', '!'    161       ¡            U+00A1
2961      '!', '!'    161       ¡            U+00A1
2962      '!', 'I'    161       ¡            U+00A1
2963      'c', '|'    162       ¢            U+00A2
2964      'c', 't'    162       ¢            U+00A2
2965      '$', '$'    163       £            U+00A3
2966      'P', 'd'    163       £            U+00A3
2967      'o', 'x'    164       ¤            U+00A4
2968      'C', 'u'    164       ¤            U+00A4
2969      'C', 'u'    164       ¤            U+00A4
2970      'E', 'u'    164       ¤            U+00A4
2971      'Y', '-'    165       ¥            U+00A5
2972      'Y', 'e'    165       ¥            U+00A5
2973      '|', '|'    166       ¦            U+00A6
2974      'B', 'B'    166       ¦            U+00A6
2975      'p', 'a'    167       §            U+00A7
2976      'S', 'E'    167       §            U+00A7
2977      '"', '"'    168       ¨            U+00A8
2978      ''', ':'    168       ¨            U+00A8
2979      'c', 'O'    169       ©            U+00A9
2980      'C', 'o'    169       ©            U+00A9
2981      'a', '-'    170       ª            U+00AA
2982      '<', '<'    171       «            U+00AB
2983      '-', ','    172       ¬            U+00AC
2984      'N', 'O'    172       ¬            U+00AC
2985      '-', '-'    173       ­            U+00AD
2986      'r', 'O'    174       ®            U+00AE
2987      'R', 'g'    174       ®            U+00AE
2988      '-', '='    175       ¯            U+00AF
2989      ''', 'm'    175       ¯            U+00AF
2990      '~', 'o'    176       °            U+00B0
2991      'D', 'G'    176       °            U+00B0
2992      '+', '-'    177       ±            U+00B1
2993      '2', '2'    178       ²            U+00B2
2994      '2', 'S'    178       ²            U+00B2
2995      '3', '3'    179       ³            U+00B3
2996      '3', 'S'    179       ³            U+00B3
2997      ''', '''    180       ´            U+00B4
2998      'j', 'u'    181       µ            U+00B5
2999      'M', 'y'    181       µ            U+00B5
3000      'p', 'p'    182       ¶            U+00B6
3001      'P', 'I'    182       ¶            U+00B6
3002      '~', '.'    183       ·            U+00B7
3003      '.', 'M'    183       ·            U+00B7
3004      ',', ','    184       ¸            U+00B8
3005      ''', ','    184       ¸            U+00B8
3006      '1', '1'    185       ¹            U+00B9
3007      '1', 'S'    185       ¹            U+00B9
3008      'o', '-'    186       º            U+00BA
3009      '>', '>'    187       »            U+00BB
3010      '1', '4'    188       ¼            U+00BC
3011      '1', '2'    189       ½            U+00BD
3012      '3', '4'    190       ¾            U+00BE
3013      '~', '?'    191       ¿            U+00BF
3014      '?', '?'    191       ¿            U+00BF
3015      '?', 'I'    191       ¿            U+00BF
3016      'A', '`'    192       À            U+00C0
3017      'A', '!'    192       À            U+00C0
3018      'A', '''    193       Á            U+00C1
3019      'A', '^'    194       Â            U+00C2
3020      'A', '>'    194       Â            U+00C2
3021      'A', '~'    195       Ã            U+00C3
3022      'A', '?'    195       Ã            U+00C3
3023      'A', '"'    196       Ä            U+00C4
3024      'A', ':'    196       Ä            U+00C4
3025      'A', '@@'    197       Å            U+00C5
3026      'A', 'A'    197       Å            U+00C5
3027      'A', 'E'    198       Æ            U+00C6
3028      'C', ','    199       Ç            U+00C7
3029      'E', '`'    200       È            U+00C8
3030      'E', '!'    200       È            U+00C8
3031      'E', '''    201       É            U+00C9
3032      'E', '^'    202       Ê            U+00CA
3033      'E', '>'    202       Ê            U+00CA
3034      'E', '"'    203       Ë            U+00CB
3035      'E', ':'    203       Ë            U+00CB
3036      'I', '`'    204       Ì            U+00CC
3037      'I', '!'    204       Ì            U+00CC
3038      'I', '''    205       Í            U+00CD
3039      'I', '^'    206       Î            U+00CE
3040      'I', '>'    206       Î            U+00CE
3041      'I', '"'    207       Ï            U+00CF
3042      'I', ':'    207       Ï            U+00CF
3043      'D', '-'    208       Ð            U+00D0
3044      'N', '~'    209       Ñ            U+00D1
3045      'N', '?'    209       Ñ            U+00D1
3046      'O', '`'    210       Ò            U+00D2
3047      'O', '!'    210       Ò            U+00D2
3048      'O', '''    211       Ó            U+00D3
3049      'O', '^'    212       Ô            U+00D4
3050      'O', '>'    212       Ô            U+00D4
3051      'O', '~'    213       Õ            U+00D5
3052      'O', '?'    213       Õ            U+00D5
3053      'O', '"'    214       Ö            U+00D6
3054      'O', ':'    214       Ö            U+00D6
3055      '/', '\'    215       ×            U+00D7
3056      '*', 'x'    215       ×            U+00D7
3057      'O', '/'    216       Ø            U+00D8
3058      'U', '`'    217       Ù            U+00D9
3059      'U', '!'    217       Ù            U+00D9
3060      'U', '''    218       Ú            U+00DA
3061      'U', '^'    219       Û            U+00DB
3062      'U', '>'    219       Û            U+00DB
3063      'U', '"'    220       Ü            U+00DC
3064      'U', ':'    220       Ü            U+00DC
3065      'Y', '''    221       Ý            U+00DD
3066      'I', 'p'    222       Þ            U+00DE
3067      'T', 'H'    222       Þ            U+00DE
3068      's', 's'    223       ß            U+00DF
3069      's', '"'    223       ß            U+00DF
3070      'a', '`'    224       à            U+00E0
3071      'a', '!'    224       à            U+00E0
3072      'a', '''    225       á            U+00E1
3073      'a', '^'    226       â            U+00E2
3074      'a', '>'    226       â            U+00E2
3075      'a', '~'    227       ã            U+00E3
3076      'a', '?'    227       ã            U+00E3
3077      'a', '"'    228       ä            U+00E4
3078      'a', ':'    228       ä            U+00E4
3079      'a', 'a'    229       å            U+00E5
3080      'a', 'e'    230       æ            U+00E6
3081      'c', ','    231       ç            U+00E7
3082      'e', '`'    232       è            U+00E8
3083      'e', '!'    232       è            U+00E8
3084      'e', '''    233       é            U+00E9
3085      'e', '^'    234       ê            U+00EA
3086      'e', '>'    234       ê            U+00EA
3087      'e', '"'    235       ë            U+00EB
3088      'e', ':'    235       ë            U+00EB
3089      'i', '`'    236       ì            U+00EC
3090      'i', '!'    236       ì            U+00EC
3091      'i', '''    237       í            U+00ED
3092      'i', '^'    238       î            U+00EE
3093      'i', '>'    238       î            U+00EE
3094      'i', '"'    239       ï            U+00EF
3095      'i', ':'    239       ï            U+00EF
3096      'd', '-'    240       ð            U+00F0
3097      'n', '~'    241       ñ            U+00F1
3098      'n', '?'    241       ñ            U+00F1
3099      'o', '`'    242       ò            U+00F2
3100      'o', '!'    242       ò            U+00F2
3101      'o', '''    243       ó            U+00F3
3102      'o', '^'    244       ô            U+00F4
3103      'o', '>'    244       ô            U+00F4
3104      'o', '~'    245       õ            U+00F5
3105      'o', '?'    245       õ            U+00F5
3106      'o', '"'    246       ö            U+00F6
3107      'o', ':'    246       ö            U+00F6
3108      ':', '-'    247       ÷            U+00F7
3109      'o', '/'    248       ø            U+00F8
3110      'u', '`'    249       ù            U+00F9
3111      'u', '!'    249       ù            U+00F9
3112      'u', '''    250       ú            U+00FA
3113      'u', '^'    251       û            U+00FB
3114      'u', '>'    251       û            U+00FB
3115      'u', '"'    252       ü            U+00FC
3116      'u', ':'    252       ü            U+00FC
3117      'y', '''    253       ý            U+00FD
3118      'i', 'p'    254       þ            U+00FE
3119      't', 'h'    254       þ            U+00FE
3120      'y', '"'    255       ÿ            U+00FF
3121      'y', ':'    255       ÿ            U+00FF
3122      '"', '['    196       Ä            U+00C4
3123      '"', '\'    214       Ö            U+00D6
3124      '"', ']'    220       Ü            U+00DC
3125      '"', '@{'    228       ä            U+00E4
3126      '"', '|'    246       ö            U+00F6
3127      '"', '@}'    252       ü            U+00FC
3128      '"', '~'    223       ß            U+00DF
3129 @end example 
3131 @end deffn
3133 @node Bell, Clear, Digraph, Virtual Terminal
3134 @section Bell
3136 @deffn Command bell_msg [message]
3137 (none)@*
3138 When a bell character is sent to a background window, @code{screen}
3139 displays a notification in the message line.  The notification message
3140 can be re-defined by this command.  Each occurrence
3141 of @samp{%} in @var{message} is replaced by the number of the window to
3142 which a bell has been sent, and each occurrence of @samp{^G} is replaced
3143 by the definition for bell in your termcap (usually an audible bell).
3144 The default message is
3146 @example
3147 'Bell in window %n'
3148 @end example
3150 An empty message can be supplied to the @code{bell_msg} command to suppress
3151 output of a message line (@code{bell_msg ""}).
3152 Without a parameter, the current message is shown.
3153 @end deffn
3155 @kindex C-g
3156 @deffn Command vbell [state]
3157 (@kbd{C-a C-g})@*
3158 Sets or toggles the visual bell setting for the current window. If 
3159 @code{vbell} is switched to @samp{on}, but your
3160 terminal does not support a visual bell, the visual bell message is
3161 displayed in the status line when the bell character is received. 
3162 Visual bell support of a terminal is 
3163 defined by the termcap variable @code{vb}. @xref{Bell, , Visual Bell, 
3164 termcap, The Termcap Manual}, for more information on visual bells. 
3165 The equivalent terminfo capability is @code{flash}.
3167 Per  default, @code{vbell} is @samp{off}, thus the audible bell is used.
3168 @end deffn
3170 @deffn Command vbell_msg [message]
3171 (none)@*
3172 Sets the visual bell message. @var{Message} is printed to the status
3173 line if the window receives a bell character (^G), @code{vbell} is
3174 set to @samp{on} and the terminal does not support a visual bell.
3175 The default message is @samp{Wuff, Wuff!!}.
3176 Without a parameter, the current message is shown.
3177 @end deffn
3179 @deffn Command vbellwait sec
3180 (none)@*
3181 Define a delay in seconds after each display of @code{screen} 's visual
3182 bell message. The default is 1 second.
3183 @end deffn
3185 @node Clear, Info, Bell, Virtual Terminal
3186 @section Clear
3187 @kindex C
3188 @deffn Command clear
3189 (@kbd{C-a C})@*
3190 Clears the screen and saves its contents to the scrollback buffer.
3191 @end deffn
3193 @node Info, Redisplay, Clear, Virtual Terminal
3194 @section Info
3195 @kindex i
3196 @kindex C-i
3197 @deffn Command info
3198 (@kbd{C-a i}, @kbd{C-a C-i})@*
3199 Uses the message line to display some information about the current
3200 window: the cursor position in the form @samp{(@var{column},@var{row})}
3201 starting with @samp{(1,1)}, the terminal width and height plus the size
3202 of the scrollback buffer in lines, like in @samp{(80,24)+50}, 
3203 the current state of window XON/XOFF flow control is shown like this
3204 (@pxref{Flow Control}):
3205 @example
3206   +flow     automatic flow control, currently on.
3207   -flow     automatic flow control, currently off.
3208   +(+)flow  flow control enabled. Agrees with automatic control.
3209   -(+)flow  flow control disabled. Disagrees with automatic control.
3210   +(-)flow  flow control enabled. Disagrees with automatic control.
3211   -(-)flow  flow control disabled. Agrees with automatic control.
3212 @end example
3214 The current line wrap setting (@samp{+wrap} indicates enabled, @samp{-wrap}
3215 not) is also shown. The flags @samp{ins}, @samp{org}, @samp{app}, @samp{log},
3216 @samp{mon} and @samp{nored} are displayed when the window is in insert mode,
3217 origin mode, application-keypad mode, has output logging,
3218 activity monitoring or partial redraw enabled.
3220 The currently active 
3221 character set (@samp{G0}, @samp{G1}, @samp{G2}, or @samp{G3}), and in
3222 square brackets the terminal character sets that are currently
3223 designated as @samp{G0} through @samp{G3}.  
3224 If the window is in UTF-8 mode, the string @samp{UTF-8} is shown instead.
3225 Additional modes depending on the type of the window are displayed at
3226 the end of the status line (@pxref{Window Types}).
3228 If the state machine of the terminal emulator is in a non-default state,
3229 the info line is started with a string identifying the current state.
3231 For system information use @code{time}.
3232 @end deffn
3234 @deffn Command dinfo
3235 (none)@*
3236 Show what @code{screen} thinks about your terminal. Useful if you want to know
3237 why features like color or the alternate charset don't work.
3238 @end deffn
3240 @node Redisplay, Wrap, Info, Virtual Terminal
3241 @section Redisplay
3243 @deffn Command allpartial state
3244 (none)@*
3245 If set to on, only the current cursor line is refreshed on window change.
3246 This affects all windows and is useful for slow terminal lines. The 
3247 previous setting of full/partial refresh for each window is restored
3248 with @code{allpartial off}. This is a global flag that immediately takes effect
3249 on all windows overriding the @code{partial} settings. It does not change the 
3250 default redraw behavior of newly created windows. 
3251 @end deffn
3253 @deffn Command altscreen state
3254 (none)@*
3255 If set to on, "alternate screen" support is enabled in virtual terminals,
3256 just like in xterm.  Initial setting is @samp{off}.
3257 @end deffn
3259 @deffn Command partial state
3260 (none)@*
3261 Defines whether the display should be refreshed (as with
3262 @code{redisplay}) after switching to the current window. This command
3263 only affects the current window.  To immediately affect all windows use the
3264 @code{allpartial} command.  Default is @samp{off}, of course.  This default is 
3265 fixed, as there is currently no @code{defpartial} command. 
3266 @end deffn
3268 @kindex l
3269 @kindex C-l
3270 @deffn Command redisplay
3271 (@kbd{C-a l}, @kbd{C-a C-l})@*
3272 Redisplay the current window.  Needed to get a full redisplay in
3273 partial redraw mode.
3274 @end deffn
3276 @node Wrap, Reset, Redisplay, Virtual Terminal
3277 @section Wrap
3279 @kindex r
3280 @kindex C-r
3281 @deffn Command wrap [ on | off ]
3282 (@kbd{C-a r}, @kbd{C-a C-r}) @*
3283 Sets the line-wrap setting for the current window.  When line-wrap is
3284 on, the second consecutive printable character output at the last column
3285 of a line will wrap to the start of the following line.  As an added
3286 feature, backspace (^H) will also wrap through the left margin to the
3287 previous line.  Default is @samp{on}. Without any options, the state of
3288 @code{wrap} is toggled.
3289 @end deffn
3291 @deffn Command defwrap state
3292 (none) @*
3293 Same as the @code{wrap} command except that the default setting for new 
3294 windows is changed. Initially line-wrap is on and can be toggled with the 
3295 @code{wrap} command (@kbd{C-a r}) or by means of "C-a : wrap on|off".
3296 @end deffn
3298 @node Reset, Window Size, Wrap, Virtual Terminal
3299 @section Reset
3300 @kindex Z
3301 @deffn Command reset
3302 (@kbd{C-a Z})@*
3303 Reset the virtual terminal to its ``power-on'' values. Useful when strange
3304 settings (like scroll regions or graphics character set) are left over from
3305 an application.
3306 @end deffn
3308 @node Window Size, Character Processing, Reset, Virtual Terminal
3309 @section Window Size
3310 @kindex W
3311 @deffn Command width [@code{-w}|@code{-d}] [cols [lines]]
3312 (@kbd{C-a W})@*
3313 Toggle the window width between 80 and 132 columns, or set it to
3314 @var{cols} columns if an argument is specified.  This requires a
3315 capable terminal and the termcap entries @samp{Z0} and @samp{Z1}.  See
3316 the @code{termcap} command (@pxref{Termcap}), for more information.
3317 You can also specify a height if you want to
3318 change  both  values.  The @code{-w} option tells screen to leave
3319 the display size unchanged and just set the  window  size,
3320 @code{-d} vice versa.
3321 @end deffn
3323 @deffn Command height [@code{-w}|@code{-d}] [lines [cols]]
3324 (none)@*
3325 Set the display height to a specified number of lines. When no
3326 argument is given it toggles between 24 and 42 lines display.
3327 @end deffn
3329 @node Character Processing, ,Window Size, Virtual Terminal
3330 @section Character Processing
3332 @deffn Command c1 [state]
3333 (none)@*
3334 Change c1 code processing. @samp{c1 on} tells screen to treat
3335 the input characters between 128 and 159 as control functions.
3336 Such an 8-bit code is normally the same as ESC followed by the 
3337 corresponding 7-bit code. The default setting is to process c1 
3338 codes and can be changed with the @samp{defc1} command.
3339 Users with fonts that have usable characters in the 
3340 c1 positions may want to turn this off.
3342 @end deffn
3343 @deffn Command gr [state]
3344 (none)@*
3345 Turn GR charset switching on/off. Whenever screen sees an input
3346 char with an 8th bit set, it will use the charset stored in the
3347 GR slot and print the character with the 8th bit stripped. The
3348 default (see also @samp{defgr}) is not to process GR switching because
3349 otherwise the ISO88591 charset would not work.
3350 @end deffn
3352 @deffn Command bce [state]
3353 (none)@*
3354 Change background-color-erase setting. If @samp{bce} is set to
3355 on, all characters cleared by an erase/insert/scroll/clear
3356 operation will be displayed in the current background color.
3357 Otherwise the default background color is used.
3358 @end deffn
3360 @deffn Command encoding enc [denc]
3361 (none)@*
3362 Tell screen how to interpret the input/output. The first argument
3363 sets the encoding of the current window.
3364 Each window can emulate a different encoding. The optional second
3365 parameter overwrites the encoding of the connected terminal.
3366 It should never be needed as screen uses the locale setting to detect
3367 the encoding.
3368 There is also a way to select a terminal encoding depending on
3369 the terminal type by using the @samp{KJ} termcap entry. @xref{Special Capabilities}.
3371 Supported encodings are
3372 @code{eucJP}, @code{SJIS}, @code{eucKR},
3373 @code{eucCN}, @code{Big5}, @code{GBK}, @code{KOI8-R}, @code{CP1251},
3374 @code{UTF-8}, @code{ISO8859-2}, @code{ISO8859-3},
3375 @code{ISO8859-4}, @code{ISO8859-5}, @code{ISO8859-6},
3376 @code{ISO8859-7}, @code{ISO8859-8}, @code{ISO8859-9},
3377 @code{ISO8859-10}, @code{ISO8859-15}, @code{jis}.
3379 See also @samp{defencoding}, which changes the default setting of a new
3380 window.
3381 @end deffn
3383 @deffn Command charset set
3384 (none)@*
3385 Change the current character set slot designation and charset
3386 mapping.  The first four character of @var{set}
3387 are treated as charset designators while the fifth and sixth
3388 character must be in range @samp{0} to @samp{3} and set the GL/GR
3389 charset mapping. On every position a @samp{.} may be used to indicate
3390 that the corresponding charset/mapping should not be changed
3391 (@var{set} is padded to six characters internally by appending
3392 @samp{.} chars). New windows have @samp{BBBB02} as default
3393 charset, unless a @samp{encoding} command is active.
3395 The current setting can be viewed with the @ref{Info} command.
3396 @end deffn
3398 @deffn Command utf8 [state [dstate]]
3399 (none)@*
3400 Change the encoding used in the current window. If utf8 is enabled, the
3401 strings sent to the window will be UTF-8 encoded and vice versa.
3402 Omitting the
3403 parameter toggles the setting. If a second parameter is given, the
3404 display's
3405 encoding is also changed (this should rather be done with screen's
3406 @samp{-U} option).
3407 See also @samp{defutf8}, which changes the default setting of a new
3408 window.
3409 @end deffn
3411 @deffn Command defc1 state
3412 (none)@*
3413 Same as the @samp{c1} command except that the default setting for
3414 new windows is changed. Initial setting is @samp{on}.
3415 @end deffn
3417 @deffn Command defgr state
3418 (none)@*
3419 Same as the @samp{gr} command except that the default setting for
3420 new windows is changed. Initial setting is @samp{off}.
3421 @end deffn
3423 @deffn Command defbce state
3424 (none)@*
3425 Same as the @samp{bce} command except that the default setting for
3426 new windows is changed. Initial setting is @samp{off}.
3427 @end deffn
3429 @deffn Command defencoding enc
3430 (none)@*
3431 Same as the @samp{encoding} command except that the default setting for
3432 new windows is changed. Initial setting is the encoding taken from the
3433 terminal.
3434 @end deffn
3436 @deffn Command defcharset [set]
3437 Like the @samp{charset} command except that the default setting for
3438 new windows is changed. Shows current default if called without
3439 argument.
3440 @end deffn
3442 @deffn Command defutf8 state
3443 (none)@*
3444 Same as the @samp{utf8} command except that the default setting for new
3445 windows is changed. Initial setting is @code{on} if screen was started
3446 with @samp{-U}, otherwise @code{off}.
3447 @end deffn
3449 @node Copy and Paste, Subprocess Execution, Virtual Terminal, Top
3450 @chapter Copy and Paste
3451 @cindex copy and paste
3453 For those confined to a hardware terminal, these commands provide a cut
3454 and paste facility more powerful than those provided by most windowing
3455 systems.
3457 @menu
3458 * Copy::                        Copy from scrollback to buffer
3459 * Paste::                       Paste from buffer into window
3460 * Registers::                   Longer-term storage
3461 * Screen Exchange::             Sharing data between screen users
3462 * History::                     Recalling previous input
3463 @end menu
3465 @node Copy, Paste,  , Copy and Paste
3466 @section Copying
3467 @cindex marking
3468 @cindex scrollback
3469 @kindex [
3470 @kindex C-[
3471 @kindex ESC
3472 @deffn Command copy
3473 (@kbd{C-a [}, @kbd{C-a C-[}, @kbd{C-a @key{ESC}})@*
3474 Enter copy/scrollback mode. This allows you to copy text from the
3475 current window and its history into the paste buffer. In this mode a
3476 @code{vi}-like full screen editor is active, with controls as
3477 outlined below.
3478 @end deffn
3480 @menu
3481 * Line Termination::            End copied lines with CR/LF
3482 * Scrollback::                  Set the size of the scrollback buffer
3483 * Copy Mode Keys::              Remap keys in copy mode
3484 * Movement::                    Move around in the scrollback buffer
3485 * Marking::                     Select the text you want
3486 * Repeat count::                Repeat a command
3487 * Searching::                   Find the text you want
3488 * Specials::                    Other random keys
3489 @end menu
3491 @node Line Termination, Scrollback,  , Copy
3492 @subsection CR/LF
3493 @deffn Command crlf [state]
3494 (none)@*
3495 This affects the copying of text regions with the @code{copy} command.
3496 If it is set to @samp{on}, lines will be separated by the two character
3497 sequence @samp{CR}/@samp{LF}.  Otherwise only @samp{LF} is used.
3498 @code{crlf} is off by default.
3499 When no parameter is given, the state is toggled.
3500 @end deffn
3502 @node Scrollback, Copy Mode Keys, Line Termination, Copy
3503 @subsection Scrollback
3504 To access and use the contents in the scrollback buffer, use the @code{copy} command. @xref{Copy}.
3505 @deffn Command defscrollback num
3506 (none)@*
3507 Same as the @code{scrollback} command except that the default setting
3508 for new windows is changed.  Defaults to 100.
3509 @end deffn
3511 @deffn Command scrollback num
3512 (none)@*
3513 Set the size of the scrollback buffer for the current window to
3514 @var{num} lines.  The default scrollback is 100 lines.  Use @code{info}
3515 to view the current setting.
3516 @end deffn
3518 @deffn Command compacthist [state]
3519 (none)@*
3520 This tells screen whether to suppress trailing blank lines when
3521 scrolling up text into the history buffer. Turn compacting @samp{on}
3522 to hold more useful lines in your scrollback buffer.
3523 @end deffn
3525 @node Copy Mode Keys, Movement, Scrollback, Copy
3526 @subsection Markkeys
3527 @deffn Command markkeys string
3528 (none)@*
3529 This is a method of changing the keymap used for copy/history mode.  The
3530 string is made up of @var{oldchar}=@var{newchar} pairs which are
3531 separated by @samp{:}. Example: The command @code{markkeys
3532 h=^B:l=^F:$=^E} would set some keys to be more familiar to @code{emacs}
3533 users.
3534 If your terminal sends characters, that cause you to abort copy mode,
3535 then this command may help by binding these characters to do nothing.
3536 The no-op character is `@@' and is used like this: @code{markkeys @@=L=H}
3537 if you do not want to use the `H' or `L' commands any longer. 
3538 As shown in this example, multiple keys can be assigned to one function
3539 in a single statement.
3540 @end deffn
3542 @node Movement, Marking, Copy Mode Keys, Copy
3543 @subsection Movement Keys
3545 @noindent
3546 @kbd{h}, @kbd{C-h}, or @kbd{left arrow} move the cursor left.
3548 @noindent
3549 @kbd{j}, @kbd{C-n}, or @kbd{down arrow} move the cursor down.
3551 @noindent
3552 @kbd{k}, @kbd{C-p}, or @kbd{up arrow} move the cursor up.
3554 @noindent
3555 @kbd{l} ('el'), or @kbd{right arrow} move the cursor right.
3557 @noindent
3558 @kbd{0} (zero) or @kbd{C-a} move to the leftmost column.
3560 @noindent
3561 @kbd{+} and @kbd{-} move the cursor to the leftmost column of the next
3562 or previous line.
3564 @noindent
3565 @kbd{H}, @kbd{M} and @kbd{L} move the cursor to the leftmost column
3566 of the top, center or bottom line of the window. 
3568 @noindent
3569 @kbd{|} moves to the specified absolute column.
3571 @noindent
3572 @kbd{g} or @kbd{home} moves to the beginning of the buffer.
3574 @noindent
3575 @kbd{G} or @kbd{end} moves to the specified absolute line (default: end of buffer).
3577 @noindent
3578 @kbd{%} jumps to the specified percentage of the buffer.
3580 @noindent
3581 @kbd{^} or @kbd{$} move to the first
3582 or last non-whitespace character on the line.
3584 @noindent
3585 @kbd{w}, @kbd{b}, and @kbd{e} move the cursor word by word.
3587 @noindent
3588 @kbd{B}, @kbd{E} move the cursor WORD by WORD (as in vi).
3590 @noindent
3591 @kbd{f}/@kbd{F}, @kbd{t}/@kbd{T} move the cursor forward/backward to the 
3592 next occurence of the target. (eg, '3fy' will move the cursor to the 3rd 
3593 'y' to the right.)
3595 @noindent
3596 @kbd{;} and @kbd{,} Repeat the last f/F/t/T command in the same/opposite direction.
3598 @noindent 
3599 @kbd{C-e} and @kbd{C-y} scroll the display up/down by one line
3600 while preserving the cursor position.
3602 @noindent
3603 @kbd{C-u} and @kbd{C-d} scroll the display up/down by the specified
3604 amount of lines while preserving the cursor position. (Default: half
3605 screenful).
3607 @noindent
3608 @kbd{C-b} and @kbd{C-f} move the cursor up/down a full screen.
3610 Note that Emacs-style movement keys can be specified by a .screenrc
3611 command. (@code{markkeys "h=^B:l=^F:$=^E"}) There is no simple method for
3612 a full emacs-style keymap, however, as this involves multi-character codes.
3614 @node Marking, Repeat count, Movement, Copy
3615 @subsection Marking
3617 The copy range is specified by setting two marks. The text between these
3618 marks will be highlighted. Press:
3620 @noindent
3621 @kbd{space} or @kbd{enter} to set the first or second mark respectively.
3622 If @code{mousetrack} is set to @code{on}, marks can also be set using
3623 @kbd{left mouse click}.
3625 @noindent
3626 @kbd{Y} and @kbd{y} can be used to mark one whole line or to mark from 
3627 start of line.
3629 @noindent
3630 @kbd{W} marks exactly one word. 
3632 @node Repeat count, Searching, Marking, Copy
3633 @subsection Repeat Count
3635 Any command in copy mode can be prefixed with a number (by pressing
3636 digits @kbd{0@dots{}9}) which is taken as a repeat count. Example:
3637 @example
3638 @kbd{C-a C-[ H 10 j 5 Y}
3639 @end example
3640 @noindent
3641 will copy lines 11 to 15 into the paste buffer.
3643 @node Searching, Specials, Repeat count, Copy
3644 @subsection Searching
3646 @noindent
3647 @kbd{/} @code{vi}-like search forward.
3649 @noindent
3650 @kbd{?} @code{vi}-like search backward.
3652 @noindent
3653 @kbd{C-a s} @code{emacs} style incremental search forward.
3655 @noindent
3656 @kbd{C-r} @code{emacs} style reverse i-search.
3658 @deffn Command ignorecase [on|off]
3659 (none)@*
3660 Tell screen to ignore the case of characters in searches. Default is
3661 @code{off}. Without any options, the state of @code{ignorecase}
3662 is toggled.
3663 @end deffn
3665 @noindent
3666 @kbd{n} Repeat search in forward direction.
3668 @noindent
3669 @kbd{N} Repeat search in backward direction.
3671 @node Specials,  , Searching, Copy
3672 @subsection Specials
3674 There are, however, some keys that act differently here from in
3675 @code{vi}.  @code{Vi} does not allow to yank rectangular blocks of text,
3676 but @code{screen} does. Press:
3678 @noindent
3679 @kbd{c} or @kbd{C} to set the left or right margin respectively. If no
3680 repeat count is given, both default to the current cursor position.@*
3681 Example: Try this on a rather full text screen: 
3682 @example
3683 @kbd{C-a [ M 20 l SPACE c 10 l 5 j C SPACE}.
3684 @end example
3686 @noindent
3687 This moves one to the middle line of the screen, moves in 20 columns left,
3688 marks the beginning of the paste buffer, sets the left column, moves 5 columns
3689 down, sets the right column, and then marks the end of
3690 the paste buffer. Now try:
3691 @example
3692 @kbd{C-a [ M 20 l SPACE 10 l 5 j SPACE}
3693 @end example
3695 @noindent
3696 and notice the difference in the amount of text copied.
3698 @noindent
3699 @kbd{J} joins lines. It toggles between 4 modes: lines separated by a
3700 newline character (012), lines glued seamless, lines separated by a single
3701 space or comma separated lines. Note that you can prepend the newline
3702 character with a carriage return character, by issuing a @code{set crlf
3703 on}.
3705 @noindent
3706 @kbd{v} or @kbd{V} is for all the @code{vi} users who use @code{:set numbers} - it
3707 toggles the left margin between column 9 and 1.
3709 @noindent
3710 @kbd{a} before the final @kbd{space} key turns on append mode. Thus
3711 the contents of the paste buffer will not be overwritten, but appended to.
3713 @noindent
3714 @kbd{A} turns on append mode and sets a (second) mark.
3716 @noindent
3717 @kbd{>} sets the (second) mark and writes the contents of the paste buffer
3718 to the screen-exchange file (@file{/tmp/screen-exchange} per default)
3719 once copy-mode is finished.  @xref{Screen Exchange}.@*
3720 This example demonstrates how to dump the
3721 whole scrollback buffer to that file: 
3722 @example
3723 @kbd{C-a [ g SPACE G $ >}.
3724 @end example
3726 @noindent
3727 @kbd{C-g} gives information about the current line and column.
3729 @noindent
3730 @kbd{x} or @kbd{o} ('oh') exchanges the first mark and the current cursor position. You
3731 can use this to adjust an already placed mark.
3733 @noindent
3734 @kbd{C-l} ('el') will redraw the screen.
3736 @noindent
3737 @kbd{@@} does nothing.  Absolutely nothing.  Does not even exit copy
3738 mode.
3740 @noindent
3741 All keys not described here exit copy mode.
3743 @node Paste, Registers, Copy, Copy and Paste
3744 @section Paste
3746 @kindex ]
3747 @kindex C-]
3748 @deffn Command paste [registers [destination]]
3749 (@kbd{C-a ]}, @kbd{C-a C-]})@*
3750 Write the (concatenated) contents of the specified registers to the stdin 
3751 stream of the current window.  The register @samp{.} is treated as the
3752 paste buffer. If no parameter is specified the user is prompted to enter a 
3753 single register. The paste buffer can be filled with the 
3754 @code{copy}, @code{history} and @code{readbuf} commands.
3755 Other registers can be filled with the @code{register}, @code{readreg} and
3756 @code{paste} commands.
3757 If @code{paste} is called with a second argument, the contents of the specified
3758 registers is pasted into the named destination register rather than
3759 the window. If @samp{.} is used as the second argument, the display's paste 
3760 buffer is the destination.
3761 Note, that @code{paste} uses a wide variety of resources: Usually both, a 
3762 current window and a current display are required. But whenever a second
3763 argument is specified no current window is needed. When the source specification
3764 only contains registers (not the paste buffer) then there need not be a current
3765 display (terminal attached), as the registers are a global resource. The
3766 paste buffer exists once for every user.
3767 @end deffn
3769 @deffn Command stuff [string]
3770 (none)@*
3771 Stuff the string @var{string} in the input buffer of the current window.
3772 This is like the @code{paste} command, but with much less overhead.
3773 Without a paramter, @code{screen} will prompt for a string to stuff.
3774 You cannot paste large buffers with the @code{stuff} command. It is most
3775 useful for key bindings. @xref{Bindkey}.
3776 @end deffn
3778 @deffn Command pastefont [state]
3779 Tell screen to include font information in the paste buffer. The
3780 default is not to do so. This command is especially useful for
3781 multi character fonts like kanji.
3782 @end deffn
3784 @deffn Command slowpaste msec
3785 @deffnx Command defslowpaste msec
3786 (none)@*
3787 Define the speed text is inserted in the current window by the @code{paste} 
3788 command. If the slowpaste value is nonzero text is written character by 
3789 character.
3790 @code{screen} will pause for @var{msec} milliseconds after each write
3791 to allow the application to process the input. only use @code{slowpaste} if 
3792 your underlying system exposes flow control problems while pasting large 
3793 amounts of text. 
3794 @code{defslowpaste} specifies the default for new windows.
3795 @end deffn
3797 @deffn Command readreg [-e encoding] [register [filename]]
3798 (none)@*
3799 Does one of two things, dependent on number of arguments: with zero or one
3800 arguments it it duplicates the paste buffer contents into the register specified
3801 or entered at the prompt. With two arguments it reads the contents of the named
3802 file into the register, just as @code{readbuf} reads the screen-exchange file
3803 into the paste buffer.
3804 You can tell screen the encoding of the file via the @code{-e} option.
3805 The following example will paste the system's password file into
3806 the screen window (using register p, where a copy remains):
3808 @example
3809 C-a : readreg p /etc/passwd
3810 C-a : paste p
3811 @end example
3812 @end deffn
3814 @node Registers, Screen Exchange, Paste, Copy and Paste
3815 @section Registers
3817 @deffn Command copy_reg [key]
3818 (none)@*
3819 Removed. Use @code{readreg} instead.
3820 @end deffn
3822 @deffn Command ins_reg [key]
3823 (none)@*
3824 Removed. Use @code{paste} instead.
3825 @end deffn
3827 @deffn Command process [key]
3828 (none)@*
3829 Stuff the contents of the specified register into the @code{screen}
3830 input queue. If no argument is given you are prompted for a
3831 register name. The text is parsed as if it had been typed in from the user's
3832 keyboard. This command can be used to bind multiple actions to a single key.
3833 @end deffn
3835 @deffn Command register [-e encoding] key string
3836 (none)@*
3837 Save the specified @var{string} to the register @var{key}.
3838 The encoding of the string can be specified via the @code{-e} option.
3839 @end deffn
3841 @node Screen Exchange, History, Registers, Copy and Paste
3842 @section Screen Exchange
3844 @deffn Command bufferfile [@var{exchange-file}]
3845 (none)@*
3846 Change the filename used for reading and writing with the paste buffer.
3847 If the @var{exchange-file} parameter is omitted, @code{screen} reverts
3848 to the default of @file{/tmp/screen-exchange}.  The following example
3849 will paste the system's password file into the screen window (using the 
3850 paste buffer, where a copy remains):
3852 @example
3853 C-a : bufferfile /etc/passwd
3854 C-a < C-a ]
3855 C-a : bufferfile
3856 @end example
3857 @end deffn
3859 @kindex <
3860 @deffn Command readbuf [-e @var{encoding}] [@var{filename}]
3861 (@kbd{C-a <})@*
3862 Reads the contents of the specified file into the paste buffer.
3863 You can tell screen the encoding of the file via the @code{-e} option.
3864 If no file is specified, the screen-exchange filename is used.
3865 @end deffn
3867 @kindex =
3868 @deffn Command removebuf
3869 (@kbd{C-a =})@*
3870 Unlinks the screen-exchange file.
3871 @end deffn
3873 @kindex >
3874 @deffn Command writebuf [-e @var{encoding}] [@var{filename}]
3875 (@kbd{C-a >})@*
3876 Writes the contents of the paste buffer to the specified file, or the
3877 public accessible screen-exchange file if no filename is given.
3878 This is thought of as a primitive means of
3879 communication between @code{screen} users on the same host.
3880 If an encoding is specified the paste buffer is recoded on the fly to
3881 match the encoding.
3882 See also
3883 @kbd{C-a @key{ESC}} (@pxref{Copy}).
3884 @end deffn
3886 @node History,  , Screen Exchange, Copy and Paste
3887 @section History
3889 @kindex @{
3890 @kindex @}
3891 @deffn Command history
3892 (@kbd{C-a @{}, @kbd{C-a @}})@*
3893 Usually users work with a shell that allows easy access to previous
3894 commands.  For example, @code{csh} has the command @code{!!} to repeat
3895 the last command executed.  @code{screen} provides a primitive way of
3896 recalling ``the command that started @dots{}'': You just type the first
3897 letter of that command, then hit @kbd{C-a @{} and @code{screen} tries to
3898 find a previous line that matches with the prompt character to the left
3899 of the cursor. This line is pasted into this window's input queue.  Thus
3900 you have a crude command history (made up by the visible window and its
3901 scrollback buffer).
3902 @end deffn
3904 @node Subprocess Execution, Key Binding, Copy and Paste, Top
3905 @chapter Subprocess Execution
3906 Control Input or Output of a window by another filter process.
3907 Use with care!
3909 @menu
3910 * Exec::                        The @code{exec} command syntax.
3911 * Using Exec::                  Weird things that filters can do.
3912 @end menu
3914 @node Exec, Using Exec,  , Subprocess Execution
3915 @section Exec
3916 @deffn Command exec [[@var{fdpat}] @var{newcommand} [@var{args} ... ]]
3917 (none)@*
3918 Run a unix subprocess (specified by an executable path @var{newcommand} and 
3919 its optional arguments) in the current window. The flow of data between
3920 newcommands stdin/stdout/stderr, the process originally started (let us call it 
3921 "application-process") and 
3922 screen itself (window) is controlled by the file descriptor pattern @var{fdpat}.
3923 This pattern is basically a three character sequence representing stdin, stdout
3924 and stderr of newcommand. A dot (@code{.}) connects the file descriptor
3925 to screen. An exclamation mark (@code{!}) causes the file descriptor to be
3926 connected to the application-process. A colon (@code{:}) combines both.
3928 User input will go to newcommand unless newcommand receives the 
3929 application-process'
3930 output (@var{fdpat}s first character is @samp{!} or @samp{:}) or a pipe symbol
3931 (@samp{|}) is added to the end of @var{fdpat}.
3933 Invoking @code{exec} without arguments shows name and arguments of the currently
3934 running subprocess in this window. Only one subprocess can be running per 
3935 window.
3937 When a subprocess is running the @code{kill} command will affect it instead of 
3938 the windows process. Only one subprocess a time can be running in each window.
3940 Refer to the postscript file @file{doc/fdpat.ps} for a confusing
3941 illustration of all 21 possible combinations. Each drawing shows the digits
3942 2, 1, 0 representing the three file descriptors of newcommand. The box
3943 marked `W' is usual pty that has the application-process on its slave side.
3944 The box marked `P' is the secondary pty that now has screen at its master
3945 side.
3946 @end deffn
3948 @node Using Exec,  , Exec, Subprocess Execution
3949 @section Using Exec
3950 @noindent 
3951 Abbreviations:
3953 @itemize @bullet
3954 @item
3955 Whitespace between the word @samp{exec} and @var{fdpat} and the command name
3956 can be omitted. 
3958 @item
3959 Trailing dots and a @var{fdpat} consisting only of dots can be omitted. 
3961 @item 
3962 A simple @samp{|} is synonymous for the @samp{!..|} pattern.
3964 @item
3965 The word @samp{exec} can be omitted when the @samp{|} abbreviation is used.
3967 @item
3968 The word @samp{exec} can always be replaced by leading @samp{!}.
3969 @end itemize
3971 @noindent 
3972 Examples:
3974 @table @code
3975 @item !/bin/sh
3976 @itemx exec /bin/sh
3977 @itemx exec ... /bin/sh
3978 All of the above are equivalent.
3979 Creates another shell in the same window, while the original shell is still 
3980 running. Output of both shells is displayed and user input is sent to the new
3981 @file{/bin/sh}.
3983 @item !!stty 19200
3984 @itemx exec!stty 19200
3985 @itemx exec !.. stty 19200
3986 All of the above are equivalent.
3987 Set the speed of the window's tty. If your stty command operates on stdout,
3988 then add another @samp{!}. This is a useful command, when a screen window
3989 is directly connected to a serial line that needs to be configured.
3991 @item |less
3992 @itemx exec !..| less
3993 Both are equivalent.
3994 This adds a pager to the window output. The special character @samp{|} is 
3995 needed to give the user control over the pager although it gets its input from 
3996 the window's process. This works, because @samp{less} listens on stderr 
3997 (a behavior that @code{screen} would not expect without the @samp{|}) 
3998 when its stdin is not a tty. @code{Less} versions newer than 177 fail miserably
3999 here; good old @code{pg} still works.
4001 @item !:sed -n s/.*Error.*/\007/p
4002 Sends window output to both, the user and the sed command. The sed inserts an
4003 additional bell character (oct. 007) to the window output seen by screen.
4004 This will cause 'Bell in window x' messages, whenever the string @samp{Error}
4005 appears in the window.
4006 @end table
4008 @node Key Binding, Flow Control, Subprocess Execution, Top
4009 @chapter Key Binding
4010 @cindex key binding
4011 @cindex binding
4013 You may disagree with some of the default bindings (I know I do).  The
4014 @code{bind} command allows you to redefine them to suit your
4015 preferences.
4017 @menu
4018 * Bind::                        @code{bind} syntax.
4019 * Bind Examples::               Using @code{bind}.
4020 * Command Character::           The character used to start keyboard commands.
4021 * Help::                        Show current key bindings.
4022 * Bindkey::                     @code{bindkey} syntax.
4023 * Bindkey Examples::            Some easy examples.
4024 * Bindkey Control::             How to control the bindkey mechanism.
4025 @end menu
4027 @node Bind, Bind Examples,  , Key Binding
4028 @section The @code{bind} command
4029 @deffn Command bind [-c class] key [command [args]]
4030 (none)@*
4031 Bind a command to a key.  The @var{key} argument is either a single
4032 character, a two-character sequence of the form @samp{^x} (meaning
4033 @kbd{C-x}), a backslash followed by an octal number (specifying the
4034 ASCII code of the character), or a backslash followed by a second
4035 character, such as @samp{\^} or @samp{\\}.  The argument can also be
4036 quoted, if you like.  If no further argument is given, any previously
4037 established binding for this key is removed.  The @var{command}
4038 argument can be any command (@pxref{Command Index}).
4040 If a command class is specified via the @code{-c} option, the
4041 key is bound for the specified class.  Use the @code{command}
4042 command to activate a class. Command classes can be used
4043 to create multiple command keys or multi-character bindings.
4045 By default, most suitable commands are bound to one or more keys
4046 (@pxref{Default Key Bindings}); for instance, the command to create a
4047 new window is bound to @kbd{C-c} and @kbd{c}.  The @code{bind} command
4048 can be used to redefine the key bindings and to define new bindings.
4049 @end deffn
4051 @deffn Command unbindall
4052 (none)@*
4053 Unbind all the bindings. This can be useful when
4054 screen is used solely for its detaching abilities, such as when
4055 letting a console application run as a daemon. If, for some reason,
4056 it is necessary to bind commands after this, use 'screen -X'.
4057 @end deffn
4059 @node Bind Examples, Command Character, Bind, Key Binding
4060 @section Examples of the @code{bind} command
4061 @noindent
4062 Some examples:
4064 @example
4065 bind ' ' windows
4066 bind ^f screen telnet foobar
4067 bind \033 screen -ln -t root -h 1000 9 su
4068 @end example
4070 @noindent
4071 would bind the space key to the command that displays a list of windows
4072 (so that the command usually invoked by @kbd{C-a C-w} would also be
4073 available as @kbd{C-a space}), bind @kbd{C-f} to the command
4074 ``create a window with a TELNET connection to foobar'', and bind
4075 @key{ESC} to the command that creates an non-login window with title
4076 @samp{root} in slot #9, with a superuser shell and a scrollback buffer
4077 of 1000 lines.
4079 @example
4080 bind -c demo1 0 select 10
4081 bind -c demo1 1 select 11
4082 bind -c demo1 2 select 12
4083 bindkey "^B" command -c demo1
4084 @end example
4085 makes @kbd{C-b 0} select window 10, @kbd{C-b 1} window 11, etc.
4087 @example
4088 bind -c demo2 0 select 10
4089 bind -c demo2 1 select 11
4090 bind -c demo2 2 select 12
4091 bind - command -c demo2
4092 @end example
4093 makes @kbd{C-a - 0} select window 10, @kbd{C-a - 1} window 11, etc.
4095 @node Command Character, Help, Bind Examples, Key Binding
4096 @cindex escape character
4097 @cindex command character
4098 @section Command Character
4100 @deffn Command escape xy
4101 (none)@*
4102 Set the command character to @var{x} and the character generating a
4103 literal command character (by triggering the @code{meta} command)
4104 to @var{y} (similar to the @samp{-e} option). 
4105 Each argument is either a single character, a two-character
4106 sequence of the form @samp{^x} (meaning @kbd{C-x}), a backslash followed
4107 by an octal number (specifying the ASCII code of the character), or a
4108 backslash followed by a second character, such as @samp{\^} or
4109 @samp{\\}.  The default is @samp{^Aa}, but @samp{``} is recommended by
4110 one of the authors.
4111 @end deffn
4113 @deffn Command defescape xy
4114 (none)@*
4115 Set the default command characters. This is equivalent to the command 
4116 @code{escape} except that it is useful for multiuser sessions only. 
4117 In a multiuser session
4118 @code{escape} changes the command character of the calling user, where 
4119 @code{defescape} changes the default command characters for users that
4120 will be added later.
4121 @end deffn
4123 @kindex a
4124 @deffn Command meta
4125 (@kbd{C-a a})@*
4126 Send the command character (@kbd{C-a}) to the process in the current
4127 window.  The keystroke for this command is the second parameter to the
4128 @samp{-e} command line switch (@pxref{Invoking Screen}), or the
4129 @code{escape} .screenrc directive.
4130 @end deffn
4132 @deffn Command command [-c @var{class}]
4133 (none)@*
4134 This command has the same effect as typing the screen escape character
4135 (@kbd{C-a}). It is probably only useful for key bindings.
4136 If the @samp{-c} option is given, select the specified command class.
4137 @xref{Bind}, @xref{Bindkey}.
4138 @end deffn
4140 @node Help, Bindkey, Command Character, Key Binding
4141 @section Help
4142 @kindex ?
4143 @deffn Command help
4144 (@kbd{C-a ?})@*
4145 Displays a help screen showing you all the key bindings.  The first
4146 pages list all the internal commands followed by their bindings.
4147 Subsequent pages will display the custom commands, one command per key.
4148 Press space when you're done reading each page, or return to exit early.
4149 All other characters are ignored.
4150 If the @samp{-c} option is given, display all bound commands for the
4151 specified command class.
4152 @xref{Default Key Bindings}.
4153 @end deffn
4155 @node Bindkey, Bindkey Examples, Help, Key Binding
4156 @section Bindkey
4157 @deffn Command bindkey [@var{opts}] [@var{string} [@var{cmd} @var{args}]]
4158 (none)@*
4159 This command manages screen's input translation tables. Every
4160 entry in one of the tables tells screen how to react if a certain
4161 sequence of characters is encountered. There are three tables:
4162 one that should contain actions programmed by the user, one for
4163 the default actions used for terminal emulation and one for
4164 screen's copy mode to do cursor movement. See @ref{Input Translation}
4165 for a list of default key bindings.
4167 If the @samp{-d}
4168 option is given, bindkey modifies the default table, @samp{-m}
4169 changes the copy mode table and with neither option the user
4170 table is selected. The argument @samp{string} is the sequence of
4171 characters to which an action is bound. This can either be a fixed
4172 string or a termcap keyboard capability name (selectable with the
4173 @samp{-k} option).
4175 Some keys on a VT100 terminal can send a different
4176 string if application mode is turned on (e.g. the cursor keys).
4177 Such keys have two entries in the translation table. You can
4178 select the application mode entry by specifying the @samp{-a}
4179 option.
4181 The @samp{-t} option tells screen not to do inter-character
4182 timing. One cannot turn off the timing if a termcap capability is
4183 used.
4185 @samp{cmd} can be any of screen's commands with an arbitrary
4186 number of @samp{args}. If @samp{cmd} is omitted the key-binding is
4187 removed from the table. 
4188 @end deffn
4190 @node Bindkey Examples, Bindkey Control,Bindkey, Key Binding
4191 @section Bindkey Examples
4192 @noindent
4193 Here are some examples of keyboard bindings:
4195 @example
4196 bindkey -d
4197 @end example
4198 @noindent
4199 Show all of the default key bindings. The application mode entries
4200 are marked with [A].
4202 @example
4203 bindkey -k k1 select 1
4204 @end example
4205 @noindent
4206 Make the "F1" key switch to window one.
4208 @example
4209 bindkey -t foo stuff barfoo
4210 @end example
4211 @noindent
4212 Make @samp{foo} an abbreviation of the word @samp{barfoo}. Timeout is
4213 disabled so that users can type slowly.
4215 @example
4216 bindkey "\024" mapdefault
4217 @end example
4218 @noindent
4219 This key-binding makes @samp{C-t} an escape character for key-bindings. If
4220 you did the above @samp{stuff barfoo} binding, you can enter the word
4221 @samp{foo} by typing @samp{C-t foo}. If you want to insert a
4222 @samp{C-t} you have to press the key twice (i.e., escape the escape
4223 binding).
4225 @example
4226 bindkey -k F1 command
4227 @end example
4228 @noindent
4229 Make the F11 (not F1!) key an alternative screen
4230 escape (besides @samp{C-a}).
4232 @node Bindkey Control, , Bindkey Examples, Key Binding
4233 @section Bindkey Control
4234 @deffn Command mapdefault
4235 (none)@*
4236 Tell screen that the next input character should only be looked up
4237 in the default bindkey table.
4238 @end deffn
4239 @deffn Command mapnotnext
4240 (none)@*
4241 Like mapdefault, but don't even look in the default bindkey table.
4242 @end deffn
4243 @deffn Command maptimeout n
4244 (none)@*
4245 Set the inter-character timer for input sequence detection to a timeout
4246 of @var{n} ms. The default timeout is 300ms. Maptimeout with no
4247 arguments shows the current setting.
4248 @end deffn
4250 @node Flow Control, Termcap, Key Binding, Top
4251 @chapter Flow Control
4252 @cindex flow control
4254 @code{screen} can trap flow control characters or pass them to the
4255 program, as you see fit.  This is useful when your terminal wants to use
4256 XON/XOFF flow control and you are running a program which wants to use
4257 ^S/^Q for other purposes (i.e. @code{emacs}).
4259 @menu
4260 * Flow Control Summary::        The effect of @code{screen} flow control
4261 * Flow::                        Setting the flow control behavior
4262 * XON/XOFF::                    Sending XON or XOFF to the window
4263 @end menu
4265 @node Flow Control Summary, Flow,  , Flow Control
4266 @section About @code{screen} flow control settings
4267 Each window has a flow-control setting that determines how screen deals
4268 with the XON and XOFF characters (and perhaps the interrupt character).
4269 When flow-control is turned off, screen ignores the XON and XOFF
4270 characters, which allows the user to send them to the current program by
4271 simply typing them (useful for the @code{emacs} editor, for instance).
4272 The trade-off is that it will take longer for output from a
4273 ``normal'' program to pause in response to an XOFF.  With
4274 flow-control turned on, XON and XOFF characters are used to immediately
4275 pause the output of the current window.  You can still send these
4276 characters to the current program, but you must use the appropriate
4277 two-character screen commands (typically @kbd{C-a q} (xon) and @kbd{C-a
4278 s} (xoff)).  The xon/xoff commands are also useful for typing C-s and
4279 C-q past a terminal that intercepts these characters.
4281 Each window has an initial flow-control value set with either the
4282 @samp{-f} option or the @code{defflow} command.  By default the
4283 windows are set to automatic flow-switching.  It can then be toggled
4284 between the three states 'fixed on', 'fixed off' and 'automatic'
4285 interactively with the @code{flow} command bound to @kbd{C-a f}.
4287 The automatic flow-switching mode deals with flow control using the
4288 TIOCPKT mode (like @code{rlogin} does). If the tty driver does not
4289 support TIOCPKT, screen tries to determine the right mode based on the
4290 current setting of the application keypad --- when it is enabled,
4291 flow-control is turned off and visa versa.  Of course, you can still
4292 manipulate flow-control manually when needed.
4294 If you're running with flow-control enabled and find that pressing the
4295 interrupt key (usually C-c) does not interrupt the display until another
4296 6-8 lines have scrolled by, try running screen with the @samp{interrupt}
4297 option (add the @samp{interrupt} flag to the @code{flow} command in your
4298 .screenrc, or use the @samp{-i} command-line option).  This causes the
4299 output that @code{screen} has accumulated from the interrupted program
4300 to be flushed.  One disadvantage is that the virtual terminal's memory
4301 contains the non-flushed version of the output, which in rare cases can
4302 cause minor inaccuracies in the output.  For example, if you switch
4303 screens and return, or update the screen with @kbd{C-a l} you would see
4304 the version of the output you would have gotten without @samp{interrupt}
4305 being on.  Also, you might need to turn off flow-control (or use
4306 auto-flow mode to turn it off automatically) when running a program that
4307 expects you to type the interrupt character as input, as the
4308 @samp{interrupt} parameter only takes effect when flow-control is
4309 enabled.  If your program's output is interrupted by mistake, a simple
4310 refresh of the screen with @kbd{C-a l} will restore it.  Give each mode
4311 a try, and use whichever mode you find more comfortable.
4313 @node Flow, XON/XOFF, Flow Control Summary, Flow Control
4314 @section Flow
4315 @deffn Command defflow fstate [interrupt]
4316 (none)@*
4317 Same as the @code{flow} command except that the default setting for new
4318 windows is changed. Initial setting is `auto'.
4319 Specifying @code{flow auto interrupt} has the same effect as the
4320 command-line options @samp{-fa} and @samp{-i}.
4321 Note that if @samp{interrupt} is enabled, all existing displays are
4322 changed immediately to forward interrupt signals.
4323 @end deffn
4325 @kindex f
4326 @kindex C-f
4327 @deffn Command flow [fstate]
4328 (@kbd{C-a f}, @kbd{C-a C-f})@*
4329 Sets the flow-control mode for this window to @var{fstate}, which can be
4330 @samp{on}, @samp{off} or @samp{auto}.
4331 Without parameters it cycles the current window's
4332 flow-control setting.  Default is set by `defflow'.
4333 @end deffn
4335 @node XON/XOFF,  , Flow, Flow Control
4336 @section XON and XOFF
4337 @kindex q
4338 @kindex C-q
4339 @deffn Command xon
4340 (@kbd{C-a q}, @kbd{C-a C-q})@*
4341 Send a ^Q (ASCII XON) to the program in the current window.  Redundant
4342 if flow control is set to @samp{off} or @samp{auto}.
4343 @end deffn
4345 @kindex s
4346 @kindex C-s
4347 @deffn Command xoff
4348 (@kbd{C-a s}, @kbd{C-a C-s})@*
4349 Send a ^S (ASCII XOFF) to the program in the current window.
4350 @end deffn
4352 @node Termcap, Message Line, Flow Control, Top
4353 @chapter Termcap
4355 @code{Screen} demands the most out of your terminal so that it can
4356 perform its VT100 emulation most efficiently.  These functions provide
4357 means for tweaking the termcap entries for both your physical terminal
4358 and the one simulated by @code{screen}.
4360 @menu
4361 * Window Termcap::              Choosing a termcap entry for the window.
4362 * Dump Termcap::                Write out a termcap entry for the window.
4363 * Termcap Syntax::              The @code{termcap} and @code{terminfo} commands.
4364 * Termcap Examples::            Uses for @code{termcap}.
4365 * Special Capabilities::        Non-standard capabilities used by @code{screen}.
4366 * Autonuke::                    Flush unseen output
4367 * Obuflimit::                   Allow pending output when reading more
4368 * Character Translation::       Emulating fonts and charsets.
4369 @end menu
4371 @node Window Termcap, Dump Termcap,  , Termcap
4372 @section Choosing the termcap entry for a window
4373 Usually @code{screen} tries to emulate as much of the VT100/ANSI
4374 standard as possible. But if your terminal lacks certain capabilities
4375 the emulation may not be complete. In these cases @code{screen} has to
4376 tell the applications that some of the features are missing. This is no
4377 problem on machines using termcap, because @code{screen} can use the
4378 @code{$TERMCAP} variable to customize the standard screen termcap.
4380 But if you do a rlogin on another machine or your machine supports only
4381 terminfo this method fails. Because of this @code{screen} offers a way
4382 to deal with these cases. Here is how it works:
4384 When @code{screen} tries to figure out a terminal name for itself, it
4385 first looks for an entry named @code{screen.@var{term}}, where
4386 @var{term} is the contents of your @code{$TERM} variable.  If no such entry
4387 exists, @code{screen} tries @samp{screen} (or @samp{screen-w}, if the
4388 terminal is wide (132 cols or more)).  If even this entry cannot be
4389 found, @samp{vt100} is used as a substitute.
4391 The idea is that if you have a terminal which doesn't support an
4392 important feature (e.g. delete char or clear to EOS) you can build a new
4393 termcap/terminfo entry for @code{screen} (named
4394 @samp{screen.@var{dumbterm}}) in which this capability has been
4395 disabled.  If this entry is installed on your machines you are able to
4396 do a rlogin and still keep the correct termcap/terminfo entry.  The
4397 terminal name is put in the @code{$TERM} variable of all new windows.
4398 @code{screen} also sets the @code{$TERMCAP} variable reflecting the
4399 capabilities of the virtual terminal emulated. 
4400 Furthermore, the variable @code{$WINDOW} is set to the window number of each
4401 window.
4403 The actual set of capabilities supported by the virtual terminal depends
4404 on the capabilities supported by the physical terminal.  If, for
4405 instance, the physical terminal does not support underscore mode,
4406 @code{screen} does not put the @samp{us} and @samp{ue} capabilities into
4407 the window's @code{$TERMCAP} variable, accordingly.  However, a minimum number
4408 of capabilities must be supported by a terminal in order to run
4409 @code{screen}; namely scrolling, clear screen, and direct cursor
4410 addressing (in addition, @code{screen} does not run on hardcopy
4411 terminals or on terminals that over-strike).
4413 Also, you can customize the @code{$TERMCAP} value used by @code{screen} by
4414 using the @code{termcap} command, or by defining the variable
4415 @code{$SCREENCAP} prior to startup.  When the latter defined, its value will be
4416 copied verbatim into each window's @code{$TERMCAP} variable.  This can either
4417 be the full terminal definition, or a filename where the terminal
4418 @samp{screen} (and/or @samp{screen-w}) is defined.
4420 Note that @code{screen} honors the @code{terminfo} command if the system
4421 uses the terminfo database rather than termcap.  On such machines the
4422 @code{$TERMCAP} variable has no effect and you must use the
4423 @code{dumptermcap} command (@pxref{Dump Termcap}) and the @code{tic}
4424 program to generate terminfo entries for @code{screen} windows.
4426 When the boolean @samp{G0} capability is present in the termcap entry
4427 for the terminal on which @code{screen} has been called, the terminal
4428 emulation of @code{screen} supports multiple character sets.  This
4429 allows an application to make use of, for instance, the VT100 graphics
4430 character set or national character sets.  The following control
4431 functions from ISO 2022 are supported: @samp{lock shift G0} (@samp{SI}),
4432 @samp{lock shift G1} (@samp{SO}), @samp{lock shift G2}, @samp{lock shift
4433 G3}, @samp{single shift G2}, and @samp{single shift G3}.  When a virtual
4434 terminal is created or reset, the ASCII character set is designated as
4435 @samp{G0} through @samp{G3}.  When the @samp{G0} capability is present,
4436 screen evaluates the capabilities @samp{S0}, @samp{E0}, and @samp{C0} if
4437 present. @samp{S0} is the sequence the terminal uses to enable and start
4438 the graphics character set rather than @samp{SI}.  @samp{E0} is the
4439 corresponding replacement for @samp{SO}. @samp{C0} gives a character by
4440 character translation string that is used during semi-graphics mode.
4441 This string is built like the @samp{acsc} terminfo capability.
4443 When the @samp{po} and @samp{pf} capabilities are present in the
4444 terminal's termcap entry, applications running in a @code{screen} window
4445 can send output to the printer port of the terminal.  This allows a user
4446 to have an application in one window sending output to a printer
4447 connected to the terminal, while all other windows are still active (the
4448 printer port is enabled and disabled again for each chunk of output).
4449 As a side-effect, programs running in different windows can send output
4450 to the printer simultaneously.  Data sent to the printer is not
4451 displayed in the window. The @code{info} command displays a line starting
4452 with @samp{PRIN} while the printer is active.
4454 Some capabilities are only put into the @code{$TERMCAP} variable of the virtual
4455 terminal if they can be efficiently implemented by the physical
4456 terminal.  For instance, @samp{dl} (delete line) is only put into the
4457 @code{$TERMCAP} variable if the terminal supports either delete line itself or
4458 scrolling regions. Note that this may provoke confusion, when the
4459 session is reattached on a different terminal, as the value of @code{$TERMCAP}
4460 cannot be modified by parent processes.  You can force @code{screen} to
4461 include all capabilities in @code{$TERMCAP} with the @samp{-a}
4462 command-line option (@pxref{Invoking Screen}).
4464 The "alternate screen" capability is not enabled by default.
4465 Set the @code{altscreen} @file{.screenrc} command to enable it.
4467 @node Dump Termcap, Termcap Syntax, Window Termcap, Termcap
4468 @section Write out the window's termcap entry
4469 @kindex .
4470 @deffn Command dumptermcap
4471 (@kbd{C-a .})@*
4472 Write the termcap entry for the virtual terminal optimized for the
4473 currently active window to the file @file{.termcap} in the user's
4474 @file{$HOME/.screen} directory (or wherever @code{screen} stores its
4475 sockets. @pxref{Files}).  This termcap entry is identical to
4476 the value of the environment variable @code{$TERMCAP} that is set up by
4477 @code{screen} for each window. For terminfo based systems you will need
4478 to run a converter like @code{captoinfo} and then compile the entry with
4479 @code{tic}.
4480 @end deffn
4482 @node Termcap Syntax, Termcap Examples, Dump Termcap, Termcap
4483 @section The @code{termcap} command
4484 @deffn Command termcap term terminal-tweaks [window-tweaks]
4485 @deffnx Command terminfo term terminal-tweaks [window-tweaks]
4486 @deffnx Command termcapinfo term terminal-tweaks [window-tweaks]
4487 (none)@*
4488 Use this command to modify your terminal's termcap entry without going
4489 through all the hassles involved in creating a custom termcap entry.
4490 Plus, you can optionally customize the termcap generated for the
4491 windows.  
4492 You have to place these commands in one of the screenrc startup files, as they
4493 are meaningless once the terminal emulator is booted.
4495 If your system uses the terminfo database rather than termcap,
4496 @code{screen} will understand the @code{terminfo} command, which has the
4497 same effects as the @code{termcap} command.   Two separate commands are
4498 provided, as there are subtle syntactic differences, e.g. when parameter
4499 interpolation (using @samp{%}) is required. Note that the termcap names of
4500 the capabilities should also be used with the @code{terminfo} command.
4502 In many cases, where the arguments are valid in both terminfo and termcap
4503 syntax, you can use the command @code{termcapinfo}, which is just a
4504 shorthand for a pair of @code{termcap} and @code{terminfo} commands with
4505 identical arguments.
4506 @end deffn
4508 The first argument specifies which terminal(s) should be affected by
4509 this definition.  You can specify multiple terminal names by separating
4510 them with @samp{|}s.  Use @samp{*} to match all terminals and @samp{vt*}
4511 to match all terminals that begin with @samp{vt}.
4513 Each @var{tweak} argument contains one or more termcap defines
4514 (separated by @samp{:}s) to be inserted at the start of the appropriate
4515 termcap entry, enhancing it or overriding existing values.  The first
4516 tweak modifies your terminal's termcap, and contains definitions that
4517 your terminal uses to perform certain functions.  Specify a null string
4518 to leave this unchanged (e.g. "").  The second (optional) tweak modifies
4519 all the window termcaps, and should contain definitions that screen
4520 understands (@pxref{Virtual Terminal}).
4522 @node Termcap Examples, Special Capabilities, Termcap Syntax, Termcap
4523 @section Termcap Examples
4524 Some examples:
4526 @example
4527 termcap xterm*  xn:hs@@
4528 @end example
4530 @noindent
4531 Informs @code{screen} that all terminals that begin with @samp{xterm}
4532 have firm auto-margins that allow the last position on the screen to be
4533 updated (xn), but they don't really have a status line (no 'hs' --
4534 append @samp{@@} to turn entries off).  Note that we assume @samp{xn} for
4535 all terminal names that start with @samp{vt}, but only if you don't
4536 specify a termcap command for that terminal.
4538 @example
4539 termcap vt*  xn
4540 termcap vt102|vt220  Z0=\E[?3h:Z1=\E[?3l
4541 @end example
4543 @noindent
4544 Specifies the firm-margined @samp{xn} capability for all terminals that
4545 begin with @samp{vt}, and the second line will also add the
4546 escape-sequences to switch into (Z0) and back out of (Z1)
4547 132-character-per-line mode if this is a VT102 or VT220.  (You must
4548 specify Z0 and Z1 in your termcap to use the width-changing commands.)
4550 @example
4551 termcap vt100  ""  l0=PF1:l1=PF2:l2=PF3:l3=PF4
4552 @end example
4554 @noindent
4555 This leaves your vt100 termcap alone and adds the function key labels to
4556 each window's termcap entry.
4558 @example
4559 termcap h19|z19  am@@:im=\E@@:ei=\EO  dc=\E[P
4560 @end example
4562 @noindent
4563 Takes a h19 or z19 termcap and turns off auto-margins (am@@) and enables
4564 the insert mode (im) and end-insert (ei) capabilities (the @samp{@@} in
4565 the @samp{im} string is after the @samp{=}, so it is part of the
4566 string).  Having the @samp{im} and @samp{ei} definitions put into your
4567 terminal's termcap will cause screen to automatically advertise the
4568 character-insert capability in each window's termcap.  Each window will
4569 also get the delete-character capability (dc) added to its termcap,
4570 which screen will translate into a line-update for the terminal (we're
4571 pretending it doesn't support character deletion).
4573 If you would like to fully specify each window's termcap entry, you
4574 should instead set the @code{$SCREENCAP} variable prior to running
4575 @code{screen}.  @xref{Virtual Terminal}, for the details of the
4576 @code{screen} terminal emulation.  @xref{Top, , Termcap, termcap, The
4577 Termcap Manual}, for more information on termcap definitions.
4579 @node Special Capabilities, Autonuke, Termcap Examples, Termcap
4580 @section Special Terminal Capabilities
4581 @cindex terminal capabilities
4582 @cindex capabilities 
4583 The following table describes all terminal capabilities that are
4584 recognized by @code{screen} and are not in the termcap manual
4585 (@pxref{Top, , Termcap, termcap, The Termcap Manual}).
4586 You can place these capabilities in your termcap entries (in
4587 @file{/etc/termcap}) or use them with the commands @code{termcap},
4588 @code{terminfo} and @code{termcapinfo} in your @code{screenrc} files. It is
4589 often not possible to place these capabilities in the terminfo database.
4590 @table @samp
4591 @item LP
4592 (bool)@*
4593 Terminal has VT100 style margins (`magic margins'). Note that
4594 this capability is obsolete --- @code{screen} now uses the standard 
4595 @samp{xn} instead.
4597 @item Z0
4598 (str)@*
4599 Change width to 132 columns.
4601 @item Z1
4602 (str)@*
4603 Change width to 80 columns.
4605 @item WS
4606 (str)@*
4607 Resize display. This capability has the desired width and height as
4608 arguments.  SunView(tm) example: @samp{\E[8;%d;%dt}.
4610 @item NF
4611 (bool)@*
4612 Terminal doesn't need flow control. Send ^S and ^Q direct to
4613 the application. Same as @code{flow off}. The opposite of this
4614 capability is @samp{nx}.
4616 @item G0
4617 (bool)@*
4618 Terminal can deal with ISO 2022 font selection sequences.
4620 @item S0
4621 (str)@*
4622 Switch charset @samp{G0} to the specified charset. Default
4623 is @samp{\E(%.}.
4625 @item E0
4626 (str)@*
4627 Switch charset @samp{G0} back to standard charset. Default
4628 is @samp{\E(B}.
4630 @item C0
4631 (str)@*
4632 Use the string as a conversion table for font 0. See
4633 the @samp{ac} capability for more details.
4635 @item CS
4636 (str)@*
4637 Switch cursor-keys to application mode.
4639 @item CE
4640 (str)@*
4641 Switch cursor-keys to cursor mode.
4643 @item AN
4644 (bool)@*
4645 Enable autonuke for displays of this terminal type.
4646 (@pxref{Autonuke}).
4648 @item OL
4649 (num)@*
4650 Set the output buffer limit. See the @samp{obuflimit} command
4651 (@pxref{Obuflimit}) for more details.
4653 @item KJ
4654 (str)@*
4655 Set the encoding of the terminal. See the @samp{encoding} command
4656 (@pxref{Character Processing}) for valid encodings.
4658 @item AF
4659 (str)@*
4660 Change character foreground color in an ANSI conform way. This
4661 capability will almost always be set to @samp{\E[3%dm}
4662 (@samp{\E[3%p1%dm} on terminfo machines).
4664 @item AB
4665 (str)@*
4666 Same as @samp{AF}, but change background color.
4668 @item AX
4669 (bool)@*
4670 Does understand ANSI set default fg/bg color (@samp{\E[39m / \E[49m}).
4672 @item XC
4673 (str)@*
4674 Describe a translation of characters to strings depending on the
4675 current font.  (@pxref{Character Translation}).
4677 @item XT
4678 (bool)@*
4679 Terminal understands special xterm sequences (OSC, mouse tracking).
4681 @item C8
4682 (bool)@*
4683 Terminal needs bold to display high-intensity colors (e.g. Eterm).
4685 @item TF
4686 (bool)@*
4687 Add missing capabilities to the termcap/info entry. (Set by default).
4688 @end table
4690 @node Autonuke, Obuflimit, Special Capabilities, Termcap
4691 @section Autonuke
4692 @deffn Command autonuke @var{state}
4693 (none)@*
4694 Sets whether a clear screen sequence should nuke all the output
4695 that has not been written to the terminal. @xref{Obuflimit}.
4696 This property is set per display, not per window.
4697 @end deffn
4699 @deffn Command defautonuke @var{state}
4700 (none)@*
4701 Same as the @code{autonuke} command except that the default setting for
4702 new displays is also changed. Initial setting is @code{off}. 
4703 Note that you can use the special @code{AN} terminal capability if you
4704 want to have a terminal type dependent setting.
4705 @end deffn
4707 @node Obuflimit, Character Translation, Autonuke, Termcap
4708 @section Obuflimit
4709 @deffn Command obuflimit [@var{limit}]
4710 (none)@*
4711 If the output buffer contains more bytes than the specified limit, no
4712 more data will be read from the windows. The default value is 256. If
4713 you have a fast display (like @code{xterm}), you can set it to some 
4714 higher value. If no argument is specified, the current setting is displayed.
4715 This property is set per display, not per window.
4716 @end deffn
4718 @deffn Command defobuflimit @var{limit}
4719 (none)@*
4720 Same as the @code{obuflimit} command except that the default setting for new
4721 displays is also changed. Initial setting is 256 bytes. Note that you can use
4722 the special @code{OL} terminal capability if you want to have a terminal
4723 type dependent limit.
4724 @end deffn
4726 @node Character Translation, , Obuflimit, Termcap
4727 @section Character Translation
4728 @code{Screen} has a powerful mechanism to translate characters to
4729 arbitrary strings depending on the current font and terminal type.
4730 Use this feature if you want to work with a common standard character
4731 set (say ISO8851-latin1) even on terminals that scatter the more
4732 unusual characters over several national language font pages.
4734 Syntax:
4736 @example
4737     XC=@var{<charset-mapping>}@{,,@var{<charset-mapping>}@}
4738     @var{<charset-mapping>} := @var{<designator>}@var{<template>}@{,@var{<mapping>}@}
4739     @var{<mapping>} := @var{<char-to-be-mapped>}@var{<template-arg>}
4740 @end example
4742 The things in braces may be repeated any number of times.
4744 A @var{<charset-mapping>} tells screen how to map characters
4745 in font @var{<designator>} (@samp{B}: Ascii, @samp{A}: UK,
4746 @samp{K}: german, etc.)
4747 to strings. Every @var{<mapping>} describes to what string a single
4748 character will be translated. A template mechanism is used, as 
4749 most of the time the codes have a lot in common (for example
4750 strings to switch to and from another charset). Each occurrence
4751 of @samp{%} in @var{<template>} gets substituted with the 
4752 @var{template-arg}
4753 specified together with the character. If your strings are not
4754 similar at all, then use @samp{%} as a template and place the full
4755 string in @var{<template-arg>}. A quoting mechanism was added to make
4756 it possible to use a real @samp{%}. The @samp{\} character quotes the
4757 special characters @samp{\}, @samp{%}, and @samp{,}.
4759 Here is an example:
4761 @example
4762     termcap hp700 'XC=B\E(K%\E(B,\304[,\326\\\\,\334]'
4763 @end example
4765 This tells @code{screen}, how to translate ISOlatin1 (charset @samp{B})
4766 upper case umlaut characters on a @code{hp700} terminal that has a
4767 German charset. @samp{\304} gets translated to
4768 @samp{\E(K[\E(B} and so on.
4769 Note that this line gets parsed *three* times before the internal
4770 lookup table is built, therefore a lot of quoting is needed to
4771 create a single @samp{\}.
4773 Another extension was added to allow more emulation: If a mapping
4774 translates the unquoted @samp{%} char, it will be sent to the terminal
4775 whenever screen switches to the corresponding @var{<designator>}.
4776 In this
4777 special case the template is assumed to be just @samp{%} because
4778 the charset switch sequence and the character mappings normally
4779 haven't much in common.
4781 This example shows one use of the extension:
4782 @example
4783     termcap xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334'
4784 @end example
4786 Here, a part of the German (@samp{K}) charset is emulated on an xterm.
4787 If screen has to change to the @samp{K} charset, @samp{\E(B} will be
4788 sent
4789 to the terminal, i.e. the ASCII charset is used instead. The
4790 template is just @samp{%}, so the mapping is straightforward:
4791 @samp{[} to @samp{\304}, @samp{\} to @samp{\326}, and @samp{]} to
4792 @samp{\334}.
4794 @node Message Line, Logging, Termcap, Top
4795 @chapter The Message Line
4796 @cindex message line
4798 @code{Screen} displays informational messages and other diagnostics in a
4799 @dfn{message line} at the bottom of the screen.  If your terminal has a
4800 status line defined in its termcap, screen will use this for displaying
4801 its messages, otherwise the last line of the screen will be temporarily
4802 overwritten and output will be momentarily interrupted.  The message
4803 line is automatically removed after a few seconds delay, but it can also
4804 be removed early (on terminals without a status line) by beginning to
4805 type.
4807 @menu
4808 * Privacy Message::             Using the message line from your program.
4809 * Hardware Status Line::        Use the terminal's hardware status line.
4810 * Last Message::                Redisplay the last message.
4811 * Message Wait::                Control how long messages are displayed.
4812 @end menu
4814 @node Privacy Message, Hardware Status Line,  , Message Line
4815 @section Using the message line from your program
4816 The message line facility can be used by an application running in the
4817 current window by means of the ANSI @dfn{Privacy message} control
4818 sequence.  For instance, from within the shell, try something like:
4820 @example
4821 echo "@value{esc}^Hello world from window $WINDOW@value{esc}\"
4822 @end example
4824 where @samp{@value{esc}} is ASCII ESC and the @samp{^} that follows it
4825 is a literal caret or up-arrow.
4827 @node Hardware Status Line, Last Message, Privacy Message, Message Line
4828 @section Hardware Status Line
4829 @deffn Command hardstatus [state]
4830 @deffnx Command hardstatus [@code{always}]@code{lastline}|@code{message}|@code{ignore} [string]
4831 @deffnx Command hardstatus @code{string} [string]
4832 (none)@*
4833 This command configures the use and emulation of the terminal's
4834 hardstatus line. The first form toggles whether @code{screen}
4835 will use the hardware status line to display messages. If the
4836 flag is set to @samp{off}, these messages
4837 are overlaid in reverse video mode at the display line. The default
4838 setting is @samp{on}.
4840 The second form tells screen what to do if the terminal doesn't
4841 have a hardstatus line (i.e. the termcap/terminfo capabilities
4842 "hs", "ts", "fs" and "ds" are not set). If the type
4843 @code{lastline} is used, screen will reserve the last line of the
4844 display for the hardstatus. @code{message} uses
4845 @code{screen}'s message mechanism and
4846 @code{ignore} tells @code{screen} never to display the hardstatus.
4847 If you prepend the word @code{always} to the type (e.g., @code{alwayslastline}), @code{screen} will use
4848 the type even if the terminal supports a hardstatus line.
4850 The third form specifies the contents of the hardstatus line.
4851 @code{%h} is used as default string, i.e., the stored hardstatus of the
4852 current window (settable via @samp{ESC]0;^G} or @samp{ESC_\\}) is
4853 displayed.
4854 You can customize this to any string you like including
4855 string escapes (@pxref{String Escapes}).
4856 If you leave
4857 out the argument @var{string}, the current string is displayed.
4859 You can mix the second and third form by providing the string as
4860 additional argument.
4861 @end deffn
4863 @node Last Message, Message Wait, Hardware Status Line, Message Line
4864 @section Display Last Message
4865 @kindex m
4866 @kindex C-m
4867 @deffn Command lastmsg
4868 (@kbd{C-a m}, @kbd{C-a C-m})@*
4869 Repeat the last message displayed in the message line.  Useful if you're
4870 typing when a message appears, because (unless your terminal has a
4871 hardware status line) the message goes away when you press a key.
4872 @end deffn
4874 @node Message Wait,  , Last Message, Message Line
4875 @section Message Wait
4876 @deffn Command msgminwait sec
4877 (none)@*
4878 Defines the time @code{screen} delays a new message when another is
4879 currently displayed.  Defaults to 1 second.
4880 @end deffn
4882 @deffn Command msgwait sec
4883 (none)@*
4884 Defines the time a message is displayed, if @code{screen} is not
4885 disturbed by other activity.  Defaults to 5 seconds.
4886 @end deffn
4888 @node Logging, Startup, Message Line, Top
4889 @chapter Logging
4891 This section describes the commands for keeping a record of your session.
4893 @menu
4894 * Hardcopy::                    Dump the current screen to a file
4895 * Log::                         Log the output of a window to a file
4896 @end menu
4898 @node Hardcopy, Log,  , Logging
4899 @section hardcopy
4900 @kindex h
4901 @deffn Command hardcopy [-h] [@var{file}]
4902 (@kbd{C-a h})@*
4903 Writes out the currently displayed image to the file @var{file}, or,
4904 if no filename is specified, to @file{hardcopy.@var{n}}
4905 in the default directory, where @var{n} is the number of the
4906 current window.  This either appends or overwrites the file if it
4907 exists, as determined by the @code{hardcopy_append} command.
4908 If the option @code{-h} is specified, dump also the
4909 contents of the scrollback buffer.
4910 @end deffn
4912 @deffn Command hardcopy_append state
4913 (none)@*
4914 If set to @samp{on}, @code{screen} will append to the
4915 @file{hardcopy.@var{n}} files created by the command @code{hardcopy};
4916 otherwise, these files are overwritten each time.
4917 @end deffn
4919 @deffn Command hardcopydir directory
4920 (none)@*
4921 Defines a directory where hardcopy files will be placed.
4922 If unset, hardcopys are dumped in screen's current working
4923 directory.
4924 @end deffn
4926 @node Log,  , Hardcopy, Logging
4927 @section log
4929 @deffn Command deflog state
4930 (none)@*
4931 Same as the @code{log} command except that the default setting for new
4932 windows is changed.  Initial setting is `off'.
4933 @end deffn
4935 @kindex H
4936 @deffn Command log [state]
4937 (@kbd{C-a H})@*
4938 Begins/ends logging of the current window to the file
4939 @file{screenlog.@var{n}} in the window's default directory, where
4940 @var{n} is the number of the current window.
4941 This filename can be changed with the @samp{logfile} command.
4942 If no parameter is given,
4943 the logging state is toggled.  The session log is
4944 appended to the previous contents of the file if it already exists.  The
4945 current contents and the contents of the scrollback history are not
4946 included in the session log.  Default is @samp{off}.
4947 @end deffn
4949 @deffn Command logfile filename
4950 @deffnx Command logfile flush secs
4951 (none)@*
4952 Defines the name the log files will get. The default is @samp{screenlog.%n}.
4953 The second form changes the number of seconds @code{screen}
4954 will wait before flushing the logfile buffer to the file-system. The
4955 default value is 10 seconds.
4956 @end deffn
4958 @deffn Command logtstamp [state]
4959 @deffnx Command logtstamp @code{after} secs
4960 @deffnx Command logtstamp @code{string} string
4961 (none)@*
4962 This command controls logfile time-stamp mechanism of screen. If
4963 time-stamps are turned @samp{on}, screen adds a string containing
4964 the current time to the logfile after two minutes of inactivity.
4965 When output continues and more than another two minutes have passed,
4966 a second time-stamp is added to document the restart of the
4967 output. You can change this timeout with the second form
4968 of the command. The third form is used for customizing the time-stamp
4969 string (@samp{-- %n:%t -- time-stamp -- %M/%d/%y %c:%s --\n} by
4970 default).
4971 @end deffn
4973 @node Startup, Miscellaneous, Logging, Top
4974 @chapter Startup
4976 This section describes commands which are only useful in the
4977 @file{.screenrc} file, for use at startup.
4979 @menu
4980 * echo::                        Display a message.
4981 * sleep::                       Pause execution of the @file{.screenrc}.
4982 * Startup Message::             Control display of the copyright notice.
4983 @end menu
4985 @node echo, sleep,  , Startup
4986 @section echo
4987 @deffn Command echo [@samp{-n}] message
4988 (none)@*
4989 The echo command may be used to annoy @code{screen} users with a
4990 'message of the day'. Typically installed in a global screenrc. 
4991 The option @samp{-n} may be used to suppress the line feed.
4992 See also @code{sleep}.  
4993 Echo is also useful for online checking of environment variables.
4994 @end deffn
4996 @node sleep, Startup Message, echo, Startup
4997 @section sleep
4998 @deffn Command sleep num
4999 (none)@*
5000 This command will pause the execution of a .screenrc file for @var{num}
5001 seconds.  Keyboard activity will end the sleep.  It may be used to give
5002 users a chance to read the messages output by @code{echo}.
5003 @end deffn
5005 @node Startup Message,  , sleep, Startup
5006 @section Startup Message
5007 @deffn Command startup_message state
5008 (none)@*
5009 Select whether you want to see the copyright notice during startup.
5010 Default is @samp{on}, as you probably noticed.
5011 @end deffn
5013 @node Miscellaneous, String Escapes, Startup, Top
5014 @chapter Miscellaneous commands
5016 The commands described here do not fit well under any of the other
5017 categories.
5019 @menu
5020 * At::                          Execute a command at other displays or windows.
5021 * Break::                       Send a break signal to the window.
5022 * Debug::                       Suppress/allow debugging output.
5023 * License::                     Display the disclaimer page.
5024 * Nethack::                     Use @code{nethack}-like error messages.
5025 * Nonblock::                    Disable flow-control to a display.
5026 * Number::                      Change the current window's number.
5027 * Time::                        Display the time and load average.
5028 * Verbose::                     Display window creation commands.
5029 * Version::                     Display the version of @code{screen}.
5030 * Zombie::                      Keep dead windows.
5031 * Printcmd::                    Set command for VT100 printer port emulation.
5032 * Rendition::                   Change text attributes in caption for flagged windows.
5033 * Sorendition::                 Change the text highlighting method.
5034 * Attrcolor::                   Map attributes to colors.
5035 * Setsid::                      Change process group management.
5036 * Eval::                        Parse and execute arguments.
5037 * Maxwin::                      Set the maximum window number.
5038 * Backtick::                    Program a command for a backtick string escape.
5039 * Screen Saver::                Define a screen safer.
5040 * Zmodem::                      Define how screen treats zmodem requests.
5041 * Mousetrack::                  Set whether screen should track mouse events.
5042 @end menu
5044 @node At, Break,  , Miscellaneous
5045 @section At
5046 @deffn Command at [identifier][#|*|%] command [args]
5047 (none)@*
5048 Execute a command at other displays or windows as if it had been entered there.
5049 @code{At} changes the context (the `current window' or `current display'
5050 setting) of the command. If the first parameter describes a non-unique context,
5051 the command will be executed multiple times. If the first parameter is of the 
5052 form @samp{@var{identifier}*} then identifier is matched against user names.
5053 The command is executed once for each display of the selected user(s).
5054 If the first parameter is of the form @samp{@var{identifier}%} identifier is
5055 matched against displays. Displays are named after the ttys they attach. The
5056 prefix @samp{/dev/} or @samp{/dev/tty} may be omitted from the identifier.
5057 If @var{identifier} has a @code{#} or nothing appended it is matched against
5058 window numbers and titles. Omitting an identifier in front of the @code{#},
5059 @code{*} or @code{%} character selects all users, displays or windows because
5060 a prefix-match is performed. Note that on the affected display(s) a short
5061 message will describe what happened. 
5062 Note that the @code{#} character works as a comment introducer when it is 
5063 preceded by whitespace. This can be escaped by prefixing @code{#} with a 
5064 @code{\}. 
5065 Permission is checked for the initiator of the @code{at} command, not for the
5066 owners of the affected display(s).
5067 Caveat: 
5068 When matching against windows, the command is executed at least 
5069 once per window. Commands that change the internal arrangement of windows
5070 (like @code{other}) may be called again. In shared windows the command will
5071 be repeated for each attached display. Beware, when issuing toggle commands
5072 like @code{login}!
5073 Some commands (e.g. @code{\*Qprocess}) require
5074 that a display is associated with the target windows.  These commands may not
5075 work correctly under @code{at} looping over windows.
5076 @end deffn
5078 @node Break, Debug, At, Miscellaneous
5079 @section Break
5080 @kindex b
5081 @kindex C-b
5082 @deffn Command break [duration]
5083 (@kbd{C-a b}, @kbd{C-a C-b})@*
5084 Send a break signal for @var{duration}*0.25 seconds to this window.
5085 For non-Posix systems the time interval is rounded up to full seconds.
5086 Most useful if a character device is attached to the window rather than
5087 a shell process (@pxref{Window Types}). The maximum duration of
5088 a break signal is limited to 15 seconds.
5089 @end deffn
5091 @kindex B
5092 @deffn Command pow_break
5093 (@kbd{C-a B})@*
5094 Reopen the window's terminal line and send a break condition.
5095 @end deffn
5097 @deffn Command breaktype [tcsendbreak|TIOCSBRK|TCSBRK]
5098 (none)@*
5099 Choose one of the available methods of generating a break signal for
5100 terminal devices. This command should affect the current window only.
5101 But it still behaves identical to @code{defbreaktype}. This will be changed in
5102 the future.
5103 Calling @code{breaktype} with no parameter displays the break setting for the
5104 current window.
5105 @end deffn
5107 @deffn Command defbreaktype [tcsendbreak|TIOCSBRK|TCSBRK]
5108 (none)@*
5109 Choose one of the available methods of generating a break signal for
5110 terminal devices opened afterwards. The preferred methods are 
5111 @code{tcsendbreak} and
5112 @code{TIOCSBRK}. The third, @code{TCSBRK}, blocks the complete @code{screen}
5113 session for the duration of the break, but it may be the only way to
5114 generate long breaks. @code{tcsendbreak} and @code{TIOCSBRK} may or may not
5115 produce long breaks with spikes (e.g. 4 per second). This is not only system
5116 dependent, this also differs between serial board drivers.
5117 Calling @code{defbreaktype} with no parameter displays the current setting.
5118 @end deffn
5120 @node Debug, License, Break, Miscellaneous
5121 @section Debug
5122 @deffn Command debug [on|off]
5123 (none)@*
5124 Turns runtime debugging on or off. If @code{screen} has been compiled with
5125 option @code{-DDEBUG} debugging is available and is turned on per default.
5126 Note that this command only affects debugging output from the main 
5127 @samp{SCREEN} process correctly. Debug output from attacher processes can only
5128 be turned off once and forever.
5129 @end deffn
5131 @node License, Nethack, Debug, Miscellaneous
5132 @section License
5133 @kindex ,
5134 @deffn Command license
5135 (@kbd{C-a ,})@*
5136 Display the disclaimer page. This is done whenever @code{screen} is
5137 started without options, which should be often enough.
5138 @end deffn
5140 @node Nethack, Nonblock, License, Miscellaneous
5141 @section Nethack
5142 @deffn Command nethack state
5143 (none)@*
5144 Changes the kind of error messages used by @code{screen}.  When you are
5145 familiar with the game @code{nethack}, you may enjoy the nethack-style
5146 messages which will often blur the facts a little, but are much funnier
5147 to read. Anyway, standard messages often tend to be unclear as well.
5149 This option is only available if @code{screen} was compiled with the
5150 NETHACK flag defined (@pxref{Installation}). The default setting is then
5151 determined by the presence of the environment variable
5152 @code{$NETHACKOPTIONS} and the file @code{~/.nethackrc} - if either one is
5153 present, the default is @code{on}.
5154 @end deffn
5156 @node Nonblock, Number, Nethack, Miscellaneous
5157 @section Nonblock
5158 @deffn Command nonblock [@var{state}|@var{numsecs}]
5159 Tell screen how to deal with user interfaces (displays) that cease to
5160 accept output. This can happen if a user presses ^S or a TCP/modem
5161 connection gets cut but no hangup is received. If nonblock is
5162 @code{off} (this is the default) screen waits until the display 
5163 restarts to accept the output. If nonblock is @code{on}, screen
5164 waits until the timeout is reached (@code{on} is treated as 1s). If the
5165 display still doesn't receive characters, screen will consider
5166 it ``blocked'' and stop sending characters to it. If at
5167 some time it restarts to accept characters, screen will unblock 
5168 the display and redisplay the updated window contents.
5169 @end deffn
5171 @deffn Command defnonblock @var{state}|@var{numsecs}
5172 Same as the @code{nonblock} command except that the default setting for
5173 displays is changed. Initial setting is @code{off}.
5174 @end deffn
5176 @node Number, Time, Nonblock, Miscellaneous
5177 @section Number
5178 @kindex N
5179 @deffn Command number [[+|-]@var{n}]
5180 (@kbd{C-a N})@*
5181 Change the current window's number. If the given number @var{n} is already
5182 used by another window, both windows exchange their numbers. If no argument is
5183 specified, the current window number (and title) is shown. Using either a
5184 plus (`+') or minus (`-') will change the window's number by the relative
5185 amount specified.
5186 @end deffn
5188 @node Time, Verbose, Number, Miscellaneous
5189 @section Time
5190 @kindex t
5191 @kindex C-t
5192 @deffn Command time [@var{string}]
5193 (@kbd{C-a t}, @kbd{C-a C-t})@*
5194 Uses the message line to display the time of day, the host name, and the
5195 load averages over 1, 5, and 15 minutes (if this is available on your
5196 system).  For window-specific information use @code{info} (@pxref{Info}).
5197 If a @var{string} is specified, it changes the format of the time report
5198 like it is described in the string escapes chapter (@pxref{String Escapes}). Screen uses a default of @samp{%c:%s %M %d %H%? %l%?}.
5199 @end deffn
5201 @node Verbose, Version, Time, Miscellaneous
5202 @section Verbose
5203 @deffn Command verbose [on|off]
5204 If verbose is switched on, the command name is echoed, whenever a window
5205 is created (or resurrected from zombie state). Default is off.
5206 Without a parameter, the current setting is shown.
5207 @end deffn
5209 @node Version, Zombie, Verbose, Miscellaneous
5210 @section Version
5211 @kindex v
5212 @deffn Command version
5213 (@kbd{C-a v})@*
5214 Display the version and modification date in the message line.
5215 @end deffn
5217 @node Zombie, Printcmd, Version, Miscellaneous
5218 @section Zombie
5219 @deffn Command zombie [@var{keys} [onerror] ]
5220 @deffnx Command defzombie [@var{keys}]
5221 (none)@*
5222 Per default windows are removed from the window list as soon as the
5223 windows process (e.g. shell) exits. When a string of two keys is
5224 specified to the zombie command, `dead' windows will remain in the list.
5225 The @code{kill} command may be used to remove the window. Pressing the first key
5226 in the dead window has the same effect. Pressing the second key, however,
5227 screen will attempt to resurrect the window. The process that was initially 
5228 running in the window will be launched again. Calling @code{zombie} without
5229 parameters will clear the zombie setting, thus making windows disappear when
5230 the process terminates.
5232 As the zombie setting is affected globally for all windows, this command 
5233 should only be called @code{defzombie}. Until we need this as a per window 
5234 setting, the commands @code{zombie} and @code{defzombie} are synonymous.
5236 Optionally you can put the word @code{onerror} after the keys. This will
5237 cause screen to monitor exit status of the process running in the window.
5238 If it exits normally ('0'), the window disappears. Any other exit value
5239 causes the window to become a zombie.
5240 @end deffn
5242 @node Printcmd, Rendition, Zombie, Miscellaneous
5243 @section Printcmd
5244 @deffn Command printcmd [@var{cmd}]
5245 (none)@*
5246 If @var{cmd} is not an empty string, screen will not use the terminal
5247 capabilities @code{po/pf} for printing if it detects an ansi print
5248 sequence @code{ESC [ 5 i}, but pipe the output into @var{cmd}.
5249 This should normally be a command like @samp{lpr} or
5250 @samp{cat > /tmp/scrprint}.
5251 @code{Printcmd} without an argument displays the current setting.
5252 The ansi sequence @code{ESC \} ends printing and closes the pipe.
5254 Warning: Be careful with this command! If other user have write
5255 access to your terminal, they will be able to fire off print commands.
5256 @end deffn
5258 @node Rendition, Sorendition, Printcmd, Miscellaneous
5259 @section Rendition
5260 @deffn Command rendition bell | monitor | silence | so @var{attr} [@var{color}]
5261 (none)@*
5262 Change the way screen renders the titles of windows that have monitor
5263 or bell flags set in caption or hardstatus or windowlist.
5264 See the chapter
5265 about string escapes (@pxref{String Escapes}) for the syntax of
5266 the modifiers. The default for monitor is currently @samp{=b} (bold,
5267 active colors), for bell @samp{=ub} (underline, bold and active colors), and
5268 for silence @samp{=u}.
5269 @end deffn
5271 @node Sorendition, Attrcolor, Rendition, Miscellaneous
5272 @section Sorendition
5273 @deffn Command sorendition [@var{attr} [@var{color}]]
5274 (none)@*
5275 This command has been deprecated. Use @code{rendition so} instead. 
5276 @end deffn
5278 @node Attrcolor, Setsid, Sorendition, Miscellaneous
5279 @section Attrcolor
5280 @deffn Command attrcolor @var{attrib} [@var{attribute/color-modifier}]
5281 (none)@*
5282 This command can be used to highlight attributes by changing the color of
5283 the text. If the attribute
5284 @var{attrib}
5285 is in use, the specified attribute/color modifier is also applied. If no
5286 modifier is given, the current one is deleted. See the chapter
5287 about string escapes (@pxref{String Escapes}) for the syntax of
5288 the modifier. @code{Screen} understands two pseudo-attributes, @code{i}
5289 stands for high-intensity foreground color and @code{I} for
5290 high-intensity background color.
5292 @noindent 
5293 Examples:
5294 @table @code
5295 @item attrcolor b "R"
5296 Change the color to bright red if bold text is to be printed.
5297 @item attrcolor u "-u b"
5298 Use blue text instead of underline.
5299 @item attrcolor b ".I"
5300 Use bright colors for bold text. Most terminal emulators do this
5301 already.
5302 @item attrcolor i "+b"
5303 Make bright colored text also bold.
5304 @end table
5305 @end deffn
5307 @node Setsid, Eval, Attrcolor, Miscellaneous
5308 @section Setsid
5309 @deffn Command setsid state
5310 (none)@*
5311 Normally @code{screen} uses different sessions and process groups for
5312 the windows. If setsid is turned @code{off}, this is not done
5313 anymore and all windows will be in the same process group as the
5314 screen backend process. This also breaks job-control, so be careful.
5315 The default is @code{on}, of course. This command is probably useful
5316 only in rare circumstances.
5317 @end deffn
5319 @node Eval, Maxwin, Setsid, Miscellaneous
5320 @section Eval
5321 @deffn Command eval @var{command1} [@var{command2} ...]
5322 (none)@*
5323 Parses and executes each argument as separate command.
5324 @end deffn
5326 @node Maxwin, Backtick, Eval, Miscellaneous
5327 @section Maxwin
5328 @deffn Command maxwin @var{n}
5329 (none)@*
5330 Set the maximum window number screen will create. Doesn't affect 
5331 already existing windows. The number can be increased only when there are no
5332 existing windows.
5333 @end deffn
5335 @node Backtick, Screen Saver, Maxwin, Miscellaneous
5336 @section Backtick
5337 @deffn Command backtick @var{id} @var{lifespan} @var{autorefresh} @var{command} [@var{args}]
5338 @deffnx Command backtick @var{id}
5339 (none)@*
5340 Program the backtick command with the numerical id @var{id}.
5341 The output of such a command is used for substitution of the
5342 @code{%`} string escape (@pxref{String Escapes}).
5343 The specified @var{lifespan} is the number
5344 of seconds the output is considered valid. After this time, the
5345 command is run again if a corresponding string escape is encountered.
5346 The @var{autorefresh} parameter triggers an
5347 automatic refresh for caption and hardstatus strings after the
5348 specified number of seconds. Only the last line of output is used 
5349 for substitution.
5351 If both the @var{lifespan} and the @var{autorefresh} parameters
5352 are zero, the backtick program is expected to stay in the
5353 background and generate output once in a while.
5354 In this case, the command is executed right away and screen stores
5355 the last line of output. If a new line gets printed screen will
5356 automatically refresh the hardstatus or the captions.
5358 The second form of the command deletes the backtick command 
5359 with the numerical id @var{id}.
5360 @end deffn
5362 @node Screen Saver, Zmodem, Backtick, Miscellaneous
5363 @section Screen Saver
5364 @deffn Command idle [@var{timeout} [@var{cmd} @var{args}]]
5365 (none)@*
5366 Sets a command that is run after the specified number of
5367 seconds inactivity is reached. This command will normally
5368 be the @code{blanker} command to create a screen blanker, but
5369 it can be any screen command. If no command is specified,
5370 only the timeout is set. A timeout of zero (ot the special
5371 timeout @code{off}) disables the timer. If no arguments are
5372 given, the current settings are displayed.
5373 @end deffn
5375 @deffn Command blanker
5376 (none)@*
5377 Activate the screen blanker. First the screen is cleared.
5378 If no blanker program is defined, the cursor is turned
5379 off, otherwise, the program is started and it's output is
5380 written to the screen. The screen blanker is killed with
5381 the first keypress, the read key is discarded.
5383 This command is normally used together with the @code{idle}
5384 command.
5385 @end deffn
5387 @deffn Command blankerprg [@var{program args}]
5388 Defines a blanker program. Disables the blanker program if an
5389 empty argument is given. Shows the currently set blanker program if no
5390 arguments are given.
5392 @end deffn
5394 @node Zmodem, , Screen Saver, Miscellaneous
5395 @section Zmodem
5396 @deffn Command zmodem [off|auto|catch|pass]
5397 @deffnx Command zmodem sendcmd [string]
5398 @deffnx Command zmodem recvcmd [string]
5399 (none)@*
5400 Define zmodem support for @code{screen}. @code{Screen} understands two
5401 different modes when it detects a zmodem request: @code{pass}
5402 and @code{catch}. If the mode is set to @code{pass}, screen will
5403 relay all data to the attacher until the end of the
5404 transmission is reached. In @code{catch} mode screen acts as a
5405 zmodem endpoint and starts the corresponding rz/sz commands.
5406 If the mode is set to @code{auto}, screen will use @code{catch} if
5407 the window is a tty (e.g. a serial line), otherwise it
5408 will use @code{pass}.
5410 You can define the templates screen uses in @code{catch} mode
5411 via the second and the third form.
5413 Note also that this is an experimental feature.
5414 @end deffn
5416 @node String Escapes, Environment, Miscellaneous, Top
5417 @chapter String Escapes
5418 @cindex string escapes
5419 Screen provides an escape mechanism to insert information like the
5420 current time into messages or file names. The escape character
5421 is @code{%} with one exception: inside of a window's hardstatus
5422 @code{^%} (@code{^E}) is used instead.
5424 Here is the full list of supported escapes:
5426 @table @code
5427 @item %
5428 the escape character itself
5429 @item a
5430 either @code{am} or @code{pm}
5431 @item A
5432 either @code{AM} or @code{PM}
5433 @item c
5434 current time @code{HH:MM} in 24h format
5435 @item C
5436 current time @code{HH:MM} in 12h format
5437 @item d
5438 day number
5439 @item D
5440 weekday name
5441 @item f
5442 flags of the window. @xref{Windows}, for meanings of the various flags.
5443 @item F
5444 sets %? to true if the window has the focus
5445 @item h
5446 hardstatus of the window
5447 @item H
5448 hostname of the system
5449 @item l
5450 current load of the system
5451 @item m
5452 month number
5453 @item M
5454 month name
5455 @item n
5456 window number
5457 @item P
5458 sets %? to true if the current region is in copy/paste mode
5459 @item s
5460 seconds
5461 @item S
5462 session name
5463 @item t
5464 window title
5465 @item u
5466 all other users on this window
5467 @item w
5468 all window numbers and names. With @code{-} qualifier: up to the current
5469 window; with @code{+} qualifier: starting with the window after the current
5470 one.
5471 @item W
5472 all window numbers and names except the current one
5473 @item y
5474 last two digits of the year number
5475 @item Y
5476 full year number
5477 @item ?
5478 the part to the next @code{%?} is displayed only if a @code{%} escape
5479 inside the part expands to a non-empty string
5480 @item :
5481 else part of @code{%?}
5482 @item =
5483 pad the string to the display's width (like TeX's hfill). If a
5484 number is specified, pad to the percentage of the window's width.
5485 A @code{0} qualifier tells screen to treat the number as absolute position.
5486 You can specify to pad relative to the last absolute pad position
5487 by adding a @code{+} qualifier or to pad relative to the right margin
5488 by using @code{-}. The padding truncates the string if the specified
5489 position lies before the current position. Add the @code{L} qualifier
5490 to change this.
5491 @item <
5492 same as @code{%=} but just do truncation, do not fill with spaces
5493 @item >
5494 mark the current text position for the next truncation. When
5495 screen needs to do truncation, it tries to do it in a way that
5496 the marked position gets moved to the specified percentage of
5497 the output area. (The area starts from the last absolute pad
5498 position and ends with the position specified by the truncation
5499 operator.) The @code{L} qualifier tells screen to mark the truncated
5500 parts with @samp{...}.
5501 @item @{
5502 attribute/color modifier string terminated by the next @code{@}}
5503 @item `
5504 Substitute with the output of a `backtick' command. The length
5505 qualifier is misused to identify one of the commands. @xref{Backtick}.
5506 @end table
5507 The @code{c} and @code{C} escape may be qualified with a @code{0} to
5508 make screen use
5509 zero instead of space as fill character.
5510 The @code{n} and
5511 @code{=} escapes understand
5512 a length qualifier (e.g. @code{%3n}), @code{D} and @code{M} can be
5513 prefixed with @code{L} to generate long names, @code{w} and
5514 @code{W} also show the window flags if @code{L} is given.
5516 An attribute/color modifier is is used to change the attributes or the
5517 color settings. Its format
5518 is @samp{[attribute modifier] [color description]}. The attribute modifier
5519 must be prefixed by a change type indicator if it can be confused with
5520 a color description. The following change types are known: 
5521 @table @code
5522 @item +
5523 add the specified set to the current attributes
5524 @item -
5525 remove the set from the current attributes
5526 @item !
5527 invert the set in the current attributes
5528 @item =
5529 change the current attributes to the specified set
5530 @end table
5531 The attribute set can either be specified as a hexadecimal number or
5532 a combination of the following letters: 
5533 @table @code
5534 @item d
5536 @item u
5537 underline
5538 @item b
5539 bold
5540 @item r
5541 reverse
5542 @item s
5543 standout
5544 @item B
5545 blinking
5546 @end table
5547 Colors are coded either as a hexadecimal number or two letters specifying
5548 the desired background and foreground color (in that order). The following
5549 colors are known:
5550 @table @code
5551 @item k
5552 black
5553 @item r
5555 @item g
5556 green
5557 @item y
5558 yellow
5559 @item b
5560 blue
5561 @item m
5562 magenta
5563 @item c
5564 cyan
5565 @item w
5566 white
5567 @item d
5568 default color
5569 @item .
5570 leave color unchanged
5571 @end table
5572 The capitalized versions of the letter specify bright colors. You can also
5573 use the pseudo-color @samp{i} to set just the brightness and leave the color
5574 unchanged.
5576 A one digit/letter color description is treated as foreground or
5577 background color dependent on the current attributes: if reverse mode is
5578 set, the background color is changed instead of the foreground color.
5579 If you don't like this, prefix the color with a @samp{.}. If you want
5580 the same behavior for two-letter color descriptions, also prefix them
5581 with a @samp{.}.
5583 As a special case, @samp{%@{-@}} restores the attributes and colors that
5584 were set before the last change was made (i.e. pops one level of the
5585 color-change stack).
5587 @noindent
5588 Examples:
5589 @table @samp
5590 @item G
5591 set color to bright green
5592 @item +b r
5593 use bold red
5594 @item = yd
5595 clear all attributes, write in default color on yellow background.
5596 @item %-Lw%@{= BW@}%50>%n%f* %t%@{-@}%+Lw%<
5597 The available windows centered at the current win dow and truncated to
5598 the available width. The current window is displayed white on blue.
5599 This can be used with @samp{hardstatus alwayslastline}.
5600 @item %?%F%@{.R.@}%?%3n %t%? [%h]%?
5601 The window number and title and the window's hardstatus, if one is set.
5602 Also use a red background if this is the active focus.
5603 Useful for @samp{caption string}.
5604 @end table
5607 @node Environment, Files, String Escapes, Top
5608 @chapter Environment Variables
5609 @cindex environment
5611 @table @code
5612 @item COLUMNS
5613 Number of columns on the terminal (overrides termcap entry).
5615 @item HOME
5616 Directory in which to look for .screenrc.
5618 @item LINES
5619 Number of lines on the terminal (overrides termcap entry).
5621 @item LOCKPRG
5622 Screen lock program.
5624 @item NETHACKOPTIONS
5625 Turns on @code{nethack} option.
5627 @item PATH
5628 Used for locating programs to run.
5630 @item SCREENCAP
5631 For customizing a terminal's @code{TERMCAP} value.
5633 @item SCREENDIR
5634 Alternate socket directory.
5636 @item SCREENRC
5637 Alternate user screenrc file.
5639 @item SHELL
5640 Default shell program for opening windows (default @file{/bin/sh}).
5642 @item STY
5643 Alternate socket name. If @code{screen} is invoked, and the environment variable
5644 @code{STY} is set, then it creates only a window in the running @code{screen}
5645 session rather than starting a new session.
5647 @item SYSSCREENRC
5648 Alternate system screenrc file.
5650 @item TERM
5651 Terminal name.
5653 @item TERMCAP
5654 Terminal description.
5656 @item WINDOW
5657 Window number of a window (at creation time).
5658 @end table
5660 @node Files, Credits, Environment, Top
5661 @chapter Files Referenced
5662 @cindex files
5664 @table @file
5665 @item .../screen-4.?.??/etc/screenrc
5666 @itemx .../screen-4.?.??/etc/etcscreenrc
5667 Examples in the @code{screen} distribution package for private and
5668 global initialization files.
5670 @item @code{$SYSSCREENRC}
5671 @itemx /local/etc/screenrc
5672 @code{screen} initialization commands
5674 @item @code{$SCREENRC}
5675 @itemx @code{$HOME}/.iscreenrc
5676 @itemx @code{$HOME}/.screenrc
5677 Read in after /local/etc/screenrc
5679 @item @code{$SCREENDIR}/S-@var{login}
5681 @item /local/screens/S-@var{login}
5682 Socket directories (default)
5684 @item /usr/tmp/screens/S-@var{login}
5685 Alternate socket directories.
5687 @item @var{socket directory}/.termcap
5688 Written by the @code{dumptermcap} command
5690 @item /usr/tmp/screens/screen-exchange or
5691 @itemx /tmp/screen-exchange
5692 @code{screen} interprocess communication buffer
5694 @item hardcopy.[0-9]
5695 Screen images created by the hardcopy command
5697 @item screenlog.[0-9]
5698 Output log files created by the log command
5700 @item /usr/lib/terminfo/?/* or
5701 @itemx /etc/termcap
5702 Terminal capability databases
5704 @item /etc/utmp
5705 Login records
5707 @item @code{$LOCKPRG}
5708 Program for locking the terminal.
5709 @end table
5711 @node Credits, Bugs, Files, Top
5712 @chapter Credits
5714 @noindent
5715 Authors @*
5716 =======
5718 Originally created by Oliver Laumann, this latest version was
5719 produced by Juergen Weigert, Michael Schroeder, Micah Cowan and
5720 Sadrul Habib Chowdhury.
5722 @noindent
5723 Contributors @*
5724 ============
5726 @example
5727      Ken Beal (kbeal@@amber.ssd.csd.harris.com),
5728      Rudolf Koenig (rfkoenig@@informatik.uni-erlangen.de),
5729      Toerless Eckert (eckert@@informatik.uni-erlangen.de),
5730      Wayne Davison (davison@@borland.com),
5731      Patrick Wolfe (pat@@kai.com, kailand!pat),
5732      Bart Schaefer (schaefer@@cse.ogi.edu),
5733      Nathan Glasser (nathan@@brokaw.lcs.mit.edu),
5734      Larry W. Virden (lvirden@@cas.org),
5735      Howard Chu (hyc@@hanauma.jpl.nasa.gov),
5736      Tim MacKenzie (tym@@dibbler.cs.monash.edu.au),
5737      Markku Jarvinen (mta@@@{cc,cs,ee@}.tut.fi),
5738      Marc Boucher (marc@@CAM.ORG),
5739      Doug Siebert (dsiebert@@isca.uiowa.edu),
5740      Ken Stillson (stillson@@tsfsrv.mitre.org),
5741      Ian Frechett (frechett@@spot.Colorado.EDU),
5742      Brian Koehmstedt (bpk@@gnu.ai.mit.edu),
5743      Don Smith (djs6015@@ultb.isc.rit.edu),
5744      Frank van der Linden (vdlinden@@fwi.uva.nl),
5745      Martin Schweikert (schweik@@cpp.ob.open.de),
5746      David Vrona (dave@@sashimi.lcu.com),
5747      E. Tye McQueen (tye%spillman.UUCP@@uunet.uu.net),
5748      Matthew Green (mrg@@eterna.com.au),
5749      Christopher Williams (cgw@@pobox.com),
5750      Matt Mosley (mattm@@access.digex.net),
5751      Gregory Neil Shapiro (gshapiro@@wpi.WPI.EDU),
5752      Jason Merrill (jason@@jarthur.Claremont.EDU),
5753      Johannes Zellner (johannes@@zellner.org),
5754      Pablo Averbuj (pablo@@averbuj.com).
5755 @end example
5757 @noindent
5758 Version @*
5759 =======
5761 This manual describes version @value{version} of the @code{screen}
5762 program. Its roots are a merge of a custom version 2.3PR7 by Wayne
5763 Davison and several enhancements to Oliver Laumann's version 2.0.
5764 Note that all versions numbered 2.x are copyright by Oliver Laumann.
5766 See also @xref{Availability}.
5768 @node Bugs, Installation, Credits, Top
5769 @chapter Bugs
5770 @cindex bugs
5772 Just like any other significant piece of software, @code{screen} has a
5773 few bugs and missing features.  Please send in a bug report if you have
5774 found a bug not mentioned here.
5776 @menu
5777 * Known Bugs::                  Problems we know about.
5778 * Reporting Bugs::              How to contact the maintainers.
5779 * Availability::                Where to find the latest screen version.
5780 @end menu
5782 @node Known Bugs, Reporting Bugs,  , Bugs
5783 @section Known Bugs
5785 @itemize @bullet
5786 @item
5787 @samp{dm} (delete mode) and @samp{xs} are not handled correctly (they
5788 are ignored).  @samp{xn} is treated as a magic-margin indicator.
5790 @item
5791 @code{screen} has no clue about double-high or double-wide characters. 
5792 But this is the only area where @code{vttest} is allowed to fail.
5794 @item
5795 It is not possible to change the environment variable @code{$TERMCAP}
5796 when reattaching under a different terminal type.
5798 @item
5799 The support of terminfo based systems is very limited. Adding extra
5800 capabilities to @code{$TERMCAP} may not have any effects.
5802 @item
5803 @code{screen} does not make use of hardware tabs.
5805 @item
5806 @code{screen} must be installed setuid root on most systems
5807 in order to be able to
5808 correctly change the owner of the tty device file for each window.
5809 Special permission may also be required to write the file
5810 @file{/etc/utmp}.
5812 @item
5813 Entries in @file{/etc/utmp} are not removed when @code{screen} is killed
5814 with SIGKILL.  This will cause some programs (like "w" or "rwho") to
5815 advertise that a user is logged on who really isn't.
5817 @item
5818 @code{screen} may give a strange warning when your tty has no utmp
5819 entry.
5821 @item
5822 When the modem line was hung up, @code{screen} may not automatically detach
5823 (or quit) unless the device driver sends a HANGUP signal. To detach such a 
5824 @code{screen} session use the -D or -d command line option.
5826 @item
5827 If a password is set, the command line options -d and -D still detach a 
5828 session without asking.
5830 @item
5831 Both @code{breaktype} and @code{defbreaktype} change the break generating
5832 method used by all terminal devices. The first should change a window
5833 specific setting, where the latter should change only the default for new
5834 windows.
5836 @item
5837 When attaching to a multiuser session, the user's @file{.screenrc} file is not
5838 sourced. Each users personal settings have to be included in the 
5839 @file{.screenrc} file from which the session is booted, or have to be 
5840 changed manually.
5842 @item
5843 A weird imagination is most useful to gain full advantage of all the
5844 features.
5845 @end itemize
5847 @node Reporting Bugs, Availability, Known Bugs, Bugs
5848 @section Reporting Bugs
5849 @cindex bug report
5851 If you find a bug in @code{Screen}, please send electronic mail to
5852 @w{@samp{screen@@uni-erlangen.de}}, and also to
5853 @w{@samp{bug-gnu-utils@@prep.ai.mit.edu}}.  Include the version number
5854 of @code{Screen} which you are using.  Also include in your message the
5855 hardware and operating system, the compiler used to compile, a
5856 description of the bug behavior, and the conditions that triggered the
5857 bug. Please recompile @code{screen} with the @samp{-DDEBUG} options
5858 enabled, reproduce the bug, and have a look at the debug output written to
5859 the directory @file{/tmp/debug}. If necessary quote suspect passages from the
5860 debug output and show the contents of your @file{config.h} if it matters.
5862 @node Availability,  , Reporting Bugs, Bugs
5863 @section Availability
5864 @cindex availability
5866 @code{Screen} is available under the @code{GNU} copyleft.
5868 The latest official release of @code{screen} available via anonymous
5869 ftp from @samp{prep.ai.mit.edu}, @samp{nic.funet.fi} or any other
5870 @code{GNU} distribution site.  The home site of 
5871 @code{screen} is @samp{ftp.uni-erlangen.de
5872 (131.188.3.71)}, in the directory @file{pub/utilities/screen}.
5873 The subdirectory @samp{private} contains the latest beta testing release.
5874 If you want to help, send a note to screen@@uni-erlangen.de.
5876 @node Installation, Concept Index, Bugs, Top
5877 @chapter Installation
5878 @cindex installation
5880 Since @code{screen} uses pseudo-ttys, the select system call, and
5881 UNIX-domain sockets/named pipes, it will not run under a system that
5882 does not include these features of 4.2 and 4.3 BSD UNIX.
5884 @menu
5885 * Socket Directory::            Where screen stores its handle.
5886 * Compiling Screen::
5887 @end menu
5889 @node Socket Directory,
5890 @section Socket Directory
5891 @cindex socket directory
5893 The socket directory defaults either to @file{$HOME/.screen} or simply to 
5894 @file{/tmp/screens} or preferably to @file{/usr/local/screens} chosen at 
5895 compile-time. If @code{screen} is installed
5896 setuid root, then the administrator should compile screen with an
5897 adequate (not NFS mounted) @code{SOCKDIR}. If @code{screen} is not
5898 running setuid-root, the user can specify any mode 700 directory in the
5899 environment variable @code{$SCREENDIR}.
5901 @node Compiling Screen,  , Socket Directory, Installation
5902 @section Compiling Screen
5903 @cindex compiling screen
5905 To compile and install screen:
5907 The @code{screen} package comes with a @code{GNU Autoconf} configuration 
5908 script. Before you compile the package run 
5910 @center @code{sh ./configure}
5912 This will create a @file{config.h} and @file{Makefile} for your machine.
5913 If @code{configure} fails for some reason, then look at the examples and
5914 comments found in the @file{Makefile.in} and @file{config.h.in} templates.
5915 Rename @file{config.status} to @file{config.status.@var{machine}} when
5916 you want to keep configuration data for multiple architectures. Running
5917 @code{sh ./config.status.@var{machine}} recreates your configuration 
5918 significantly faster than rerunning @code{configure}. 
5920 Read through the "User Configuration" section of @file{config.h}, and verify
5921 that it suits your needs.
5922 A comment near the top of this section explains why it's best to
5923 install screen setuid to root.
5924 Check for the place for the global @file{screenrc}-file and for the socket
5925 directory.
5927 Check the compiler used in @file{Makefile}, the prefix path where to install
5928 @code{screen}. Then run
5930 @center @code{make}
5932 If @code{make} fails to produce one of the files @file{term.h}, @file{comm.h}
5933 or @file{tty.c}, then use @code{@var{filename.x}.dist} instead.
5934 For additional information about installation of @code{screen} refer to the
5935 file @file{INSTALLATION}, coming with this package.
5937 @node Concept Index, Command Index, Installation, Top
5938 @unnumbered Concept Index
5940 @printindex cp
5942 @node Command Index, Keystroke Index, Concept Index, Top
5943 @unnumbered Command Index
5945 This is a list of all the commands supported by @code{screen}.
5947 @printindex fn
5949 @node Keystroke Index,  , Command Index, Top
5950 @unnumbered Keystroke Index
5952 This is a list of the default key bindings.
5954 The leading escape character (@pxref{Command Character}) has been omitted
5955 from the key sequences, since it is the same for all bindings.
5957 @printindex ky
5959 @bye