Allow highlighting bell/monitor windows in caption
[screen-lua.git] / src / doc / screen.1
blob53af79985239856d9b095ebd2643f308afcaf0f6
1 .\" vi:set wm=5
2 .TH SCREEN 1 "Aug 2003"
3 .if n .ds Q \&"
4 .if n .ds U \&"
5 .if t .ds Q ``
6 .if t .ds U ''
7 .UC 4
8 .SH NAME
9 screen \- screen manager with VT100/ANSI terminal emulation
12 .SH SYNOPSIS
13 .B screen
15 .B \-\fIoptions\fP
16 ] [
17 .B \fIcmd\fP
19 .B \fIargs\fP
20 ] ]
21 .br
22 .B screen \-r
23 [[\fIpid\fP\fB.\fP]\fItty\fP[\fB.\fP\fIhost\fP]]
24 .br
25 .B screen \-r
26 \fIsessionowner\fP\fB/\fP[[\fIpid\fP\fB.\fP]\fItty\fP[\fB.\fP\fIhost\fP]]
27 .ta .5i 1.8i
30 .SH DESCRIPTION
31 .I Screen
32 is a full-screen window manager that
33 multiplexes a physical terminal between several processes (typically
34 interactive shells).
35 Each virtual terminal provides the functions
36 of a DEC VT100 terminal and, in addition, several control functions
37 from the ISO 6429 (ECMA 48, ANSI X3.64) and ISO 2022 standards
38 (e.\|g. insert/delete line and support for multiple character sets).
39 There is a scrollback history buffer for each virtual terminal and a
40 copy-and-paste mechanism that allows moving text regions between
41 windows.
42 .PP
43 When
44 .I screen
45 is called, it creates a single window with a shell in it (or the specified
46 command) and then gets out of your way so that you can use the program as you
47 normally would.
48 Then, at any time, you can create new (full-screen) windows with other programs
49 in them (including more shells), kill existing windows, view a list of
50 windows, turn output logging on and off, copy-and-paste text between
51 windows, view the scrollback history, switch between windows
52 in whatever manner you wish, etc. All windows run their programs completely
53 independent of each other. Programs continue to run when their window
54 is currently not visible and even when the whole 
55 .I screen 
56 session is detached from the user's terminal.  When a program terminates,
57 .I screen
58 (per default) kills the window that contained it.
59 If this window was in the foreground, the display switches to the previous
60 window; if none are left,
61 .I screen
62 exits.
63 .PP
64 Everything you type is sent to the program running in the current window.
65 The only exception to this is the one keystroke that is used to initiate
66 a command to the window manager.
67 By default, each command begins with a control-a (abbreviated C-a from
68 now on), and is followed by one other keystroke.
69 The command character and all the key bindings can be fully customized
70 to be anything you like, though they are always two characters in length.
71 .PP
72 .I Screen
73 does not understand the prefix \*QC-\*U to mean control. 
74 Please use the caret notation (\*Q^A\*U instead of \*QC-a\*U) as arguments
75 to e.g. the 
76 .I escape
77 command or the \fI-e\fP option.
78 .I Screen
79 will also print out control characters in caret notation.
80 .PP
81 The standard way to create a new window is to type \*QC-a c\*U.
82 This creates a new window running a shell and switches to that
83 window immediately, regardless of the state of the process running
84 in the current window.
85 Similarly, you can create a new window with a custom command in it by
86 first binding the command to a keystroke (in your .screenrc file or at the
87 \*QC-a :\*U command line) and
88 then using it just like the \*QC-a c\*U command.
89 In addition, new windows can be created by running a command like:
90 .IP
91 screen emacs prog.c
92 .PP
93 from a shell prompt within a previously created window.
94 This will not run another copy of
95 .IR screen ,
96 but will instead supply the command name and its arguments to the window
97 manager (specified in the $STY environment variable) who will use it to
98 create the new window.
99 The above example would start the emacs editor (editing prog.c) and switch
100 to its window.
102 If \*Q/etc/utmp\*U is writable by
103 .IR screen ,
104 an appropriate record will be written to this file for each window, and
105 removed when the window is terminated.
106 This is useful for working with \*Qtalk\*U, \*Qscript\*U, \*Qshutdown\*U,
107 \*Qrsend\*U, \*Qsccs\*U and other similar programs that use the utmp
108 file to determine who you are. As long as
109 .I screen
110 is active on your terminal,
111 the terminal's own record is removed from the utmp file. See also \*QC-a L\*U.
114 .SH GETTING STARTED
115 Before you begin to use
116 .I screen
117 you'll need to make sure you have correctly selected your terminal type,
118 just as you would for any other termcap/terminfo program.
119 (You can do this by using
120 .IR tset
121 for example.)
123 If you're impatient and want to get started without doing a lot more reading,
124 you should remember this one command:  \*QC-a ?\*U.
125 Typing these two characters will display a list of the available
126 .I screen
127 commands and their bindings. Each keystroke is discussed in
128 the section \*QDEFAULT KEY BINDINGS\*U. The manual section \*QCUSTOMIZATION\*U
129 deals with the contents of your .screenrc.
131 If your terminal is a \*Qtrue\*U auto-margin terminal (it doesn't allow
132 the last position on the screen to be updated without scrolling the
133 screen) consider using a version of your terminal's termcap that has
134 automatic margins turned \fIoff\fP. This will ensure an accurate and
135 optimal update of the screen in all circumstances. Most terminals
136 nowadays have \*Qmagic\*U margins (automatic margins plus usable last
137 column). This is the VT100 style type and perfectly suited for
138 .IR screen .
139 If all you've got is a \*Qtrue\*U auto-margin terminal 
140 .I screen
141 will be content to use it, but updating a character put into the last
142 position on the screen may not be possible until the screen scrolls or
143 the character is moved into a safe position in some other way. This
144 delay can be shortened by using a terminal with insert-character
145 capability.
148 .SH "COMMAND-LINE OPTIONS"
149 Screen has the following command-line options:
150 .TP 5
151 .B \-a
152 include \fIall\fP capabilities (with some minor exceptions) in each
153 window's termcap, even if
154 .I screen
155 must redraw parts of the display in order to implement a function.
156 .TP 5
157 .B \-A
158 Adapt the sizes of all windows to the size of the current terminal.
159 By default,
160 .I screen
161 tries to restore its old window sizes when attaching to resizable terminals
162 (those with \*QWS\*U in its description, e.g. suncmd or some xterm).
163 .TP 5
164 .BI "\-c " file
165 override the default configuration file from \*Q$HOME/.screenrc\*U
166 to \fIfile\fP.
167 .TP 5
168 .BR \-d | \-D " [" \fIpid.tty.host ]
169 does not start
170 .IR screen ,
171 but detaches the elsewhere running
172 .I screen
173 session. It has the same effect as typing \*QC-a d\*U from
174 .IR screen 's
175 controlling terminal. \fB\-D\fP is the equivalent to the power detach key.
176 If no session can be detached, this option is ignored. In combination with the
177 \fB\-r\fP/\fB\-R\fP option more powerful effects can be achieved:
178 .TP 8
179 .B \-d \-r
180 Reattach a session and if necessary detach it first.
181 .TP 8
182 .B \-d \-R
183 Reattach a session and if necessary detach or even create it first.
184 .TP 8
185 .B \-d \-RR
186 Reattach a session and if necessary detach or create it. Use the first
187 session if more than one session is available.
188 .TP 8
189 .B \-D \-r
190 Reattach a session. If necessary detach and logout remotely first.
191 .TP 8
192 .B \-D \-R
193 Attach here and now. In detail this means: If a session is running, then
194 reattach. If necessary detach and logout remotely first.
195 If it was not running create it and notify the user. This is the
196 author's favorite.
197 .TP 8
198 .B \-D \-RR
199 Attach here and now. Whatever that means, just do it.
200 .IP "" 5
201 Note: It is always a good idea to check the status of your sessions by means of
202 \*Qscreen \-list\*U.
203 .TP 5
204 .BI "\-e " xy
205 specifies the command character to be \fIx\fP and the character generating a
206 literal command character to \fIy\fP (when typed after the command character).
207 The default is \*QC-a\*U and `a', which can be specified as \*Q-e^Aa\*U.
208 When creating a
209 .I screen
210 session, this option sets the default command character. In a multiuser
211 session all users added will start off with this command character. But
212 when attaching to an already running session, this option changes only
213 the command character of the attaching user.
214 This option is equivalent to either the commands \*Qdefescape\*U or
215 \*Qescape\*U respectively.
216 .TP 5
217 .BR \-f\fP ", " \-fn ", and " \-fa
218 turns flow-control on, off, or \*Qautomatic switching mode\*U.
219 This can also be defined through the \*Qdefflow\*U .screenrc command.
220 .TP 5
221 .BI "\-h " num
222 Specifies the history scrollback buffer to be \fInum\fP lines high.
223 .TP 5
224 .B \-i
225 will cause the interrupt key (usually C-c) to interrupt the display
226 immediately when flow-control is on.
227 See the \*Qdefflow\*U .screenrc command for details.
228 The use of this option is discouraged.
229 .TP 5
230 .BR \-l " and " \-ln
231 turns login mode on or off (for /etc/utmp updating).
232 This can also be defined through the \*Qdeflogin\*U .screenrc command.
233 .TP 5
234 .BR \-ls " and " \-list
235 does not start
236 .IR screen ,
237 but prints a list of
238 .I pid.tty.host
239 strings identifying your
240 .I screen
241 sessions.
242 Sessions marked `detached' can be resumed with \*Qscreen -r\*U. Those marked
243 `attached' are running and have a controlling terminal. If the session runs in 
244 multiuser mode, it is marked `multi'. Sessions marked as `unreachable' either
245 live on a different host or are `dead'.
246 An unreachable session is considered dead, when its name
247 matches either the name of the local host, or the specified parameter, if any.
248 See the \fB-r\fP flag for a description how to construct matches.
249 Sessions marked as `dead' should be thoroughly checked and removed. 
250 Ask your system administrator if you are not sure. Remove sessions with the 
251 \fB-wipe\fP option. 
252 .TP 5
253 .B \-L
254 tells
255 .I screen
256 to turn on automatic output logging for the windows.
257 .TP 5
258 .B \-m
259 causes
260 .I screen
261 to ignore the $STY environment variable. With \*Qscreen -m\*U creation of
262 a new session is enforced, regardless whether
263 .I screen
264 is called from within another
265 .I screen
266 session or not. This flag has a special meaning in connection
267 with the `-d' option:
268 .TP 8
269 .B \-d \-m
270 Start
271 .I screen
272 in \*Qdetached\*U mode. This creates a new session but doesn't
273 attach to it. This is useful for system startup scripts.
274 .TP 8
275 .B \-D \-m
276 This also starts screen in \*Qdetached\*U mode, but doesn't fork
277 a new process. The command exits if the session terminates.
278 .TP 5
279 .B \-O
280 selects a more optimal output mode for your terminal rather than true VT100
281 emulation (only affects auto-margin terminals without `LP').
282 This can also be set in your .screenrc by specifying `OP' in a \*Qtermcap\*U
283 command.
284 .TP 5
285 .BI "\-p " number_or_name
286 Preselect a window. This is useful when you want to reattach to a
287 specific window or you want to send a command via the \*Q-X\*U
288 option to a specific window. As with screen's select command, \*Q-\*U
289 selects the blank window. As a special case for reattach, \*Q=\*U
290 brings up the windowlist on the blank window.
291 .TP 5
292 .B \-q
293 Suppress printing of error messages. In combination with \*Q-ls\*U the exit 
294 value is as follows: 9 indicates a directory without sessions. 10 
295 indicates a directory with running but not attachable sessions. 11 (or more) 
296 indicates 1 (or more) usable sessions.
297 In combination with \*Q-r\*U the exit value is as follows: 10 indicates that 
298 there is no session to resume. 12 (or more) indicates that there are 2 (or 
299 more) sessions to resume and you should specify which one to choose. 
300 In all other cases \*Q-q\*U has no effect.
301 .TP 5
302 .BR \-r " [" \fIpid.tty.host ]
303 .PD 0
304 .TP 5
305 .BR \-r " \fIsessionowner/[" \fIpid.tty.host ]
307 resumes a detached
308 .I screen
309 session.  No other options (except combinations with \fB\-d\fP/\fB\-D\fP) may
310 be specified, though an optional prefix of [\fIpid.\fP]\fItty.host\fP
311 may be needed to distinguish between multiple detached
312 .I screen
313 sessions.  The second form is used to connect to another user's screen session
314 which runs in multiuser mode. This indicates that screen should look for
315 sessions in another user's directory. This requires setuid-root.
316 .TP 5
317 .B \-R
318 attempts to resume the first detached
319 .I screen
320 session it finds.  If successful, all other command-line options are ignored.
321 If no detached session exists, starts a new session using the specified
322 options, just as if
323 .B \-R
324 had not been specified. The option is set by default if
325 .I screen
326 is run as a login-shell (actually screen uses \*Q-xRR\*U in that case).
327 For combinations with the \fB\-d\fP/\fB\-D\fP option see there.
328 .TP 5
329 .B \-s
330 sets the default shell to the program specified, instead of the value
331 in the environment variable $SHELL (or \*Q/bin/sh\*U if not defined).
332 This can also be defined through the \*Qshell\*U .screenrc command.
333 .TP 5
334 .BI "\-S " sessionname
335 When creating a new session, this option can be used to specify a
336 meaningful name for the session. This name identifies the session for
337 \*Qscreen -list\*U and \*Qscreen -r\*U actions. It substitutes the
338 default [\fItty.host\fP] suffix.
339 .TP 5
340 .BI "\-t " name
341 sets the title (a.\|k.\|a.) for the default shell or specified program.
342 See also the \*Qshelltitle\*U .screenrc command.
343 .TP 5
344 .B \-U
345 Run screen in UTF-8 mode. This option tells screen that your terminal
346 sends and understands UTF-8 encoded characters. It also sets the default
347 encoding for new windows to `utf8'.
348 .TP 5
349 .B \-v
350 Print version number.
351 .TP 5
352 .BR \-wipe " [" \fImatch ]
353 does the same as \*Qscreen -ls\*U, but removes destroyed sessions instead of
354 marking them as `dead'.
355 An unreachable session is considered dead, when its name matches either 
356 the name of the local host, or the explicitly given parameter, if any.
357 See the \fB-r\fP flag for a description how to construct matches.
358 .TP 5
359 .B \-x
360 Attach to a not detached
361 .I screen
362 session. (Multi display mode).
363 .I Screen
364 refuses to attach from within itself. 
365 But when cascading multiple screens, loops are not detected; take care.
366 .TP 5
367 .B \-X
368 Send the specified command to a running screen session. You can use
369 the \fB-d\fP or \fB-r\fP option to tell screen to look only for
370 attached or detached screen sessions. Note that this command doesn't
371 work if the session is password protected.
374 .SH "DEFAULT KEY BINDINGS"
375 .ta 12n 26n
376 As mentioned, each
377 .I screen
378 command consists of a
379 \*QC-a\*U followed by one other character.
380 For your convenience, all commands that are bound to lower-case letters are
381 also bound to their control character counterparts (with the exception
382 of \*QC-a a\*U; see below), thus, \*QC-a c\*U as well as \*QC-a C-c\*U can
383 be used to create a window. See section \*QCUSTOMIZATION\*U for a description
384 of the command.
386 .TP 26n
387 The following table shows the default key bindings:
388 .IP "\fBC-a '\fP        (select)"
389 Prompt for a window name or number to switch to.
390 .IP "\fBC-a ""\fP       (windowlist -b)"
391 Present a list of all windows for selection.
392 .IP "\fBC-a 0\fP        (select 0)"
393 .PD 0
394 .IP "\fB ... \fP           ..."
395 .IP "\fBC-a 9\fP        (select 9)"
396 .IP "\fBC-a -\fP        (select -)"
398 Switch to window number 0 \- 9, or to the blank window.
399 .IP "\fBC-a tab\fP      (focus)"
401 Switch the input focus to the next region.
402 See also \fIsplit, remove, only\fP.
403 .IP "\fBC-a C-a\fP      (other)"
404 Toggle to the window displayed previously.
405 Note that this binding defaults to the command character typed twice,
406 unless overridden.  For instance, if you use the option \*Q\fB\-e]x\fP\*U,
407 this command becomes \*Q]]\*U.
408 .IP "\fBC-a a\fP        (meta)"
409 Send the command character (C-a) to window. See \fIescape\fP command.
410 .IP "\fBC-a A\fP        (title)"
411 Allow the user to enter a name for the current window.
412 .IP "\fBC-a b\fP"
413 .PD 0
414 .IP "\fBC-a C-b\fP      (break)"
416 Send a break to window.
417 .IP "\fBC-a B\fP        (pow_break)"
418 Reopen the terminal line and send a break.
419 .IP "\fBC-a c\fP"
420 .PD 0
421 .IP "\fBC-a C-c\fP      (screen)"
423 Create a new window with a shell and switch to that window.
424 .IP "\fBC-a C\fP        (clear)"
425 Clear the screen.
426 .IP "\fBC-a d\fP"
427 .PD 0
428 .IP "\fBC-a C-d\fP      (detach)"
430 Detach
431 .I screen
432 from this terminal.
433 .IP "\fBC-a D D\fP      (pow_detach)"
434 Detach and logout.
435 .IP "\fBC-a f\fP"
436 .PD 0
437 .IP "\fBC-a C-f\fP      (flow)"
439 Toggle flow \fIon\fP, \fIoff\fP or \fIauto\fP.
440 .IP "\fBC-a F\fP        (fit)"
441 Resize the window to the current region size.
442 .IP "\fBC-a C-g\fP      (vbell)"
443 Toggles
444 .I screen's
445 visual bell mode.
446 .IP "\fBC-a h\fP        (hardcopy)"
448 Write a hardcopy of the current window to the file \*Qhardcopy.\fIn\fP\*U.
449 .IP "\fBC-a H\fP        (log)"
450 Begins/ends logging of the current window to the file \*Qscreenlog.\fIn\fP\*U.
451 .IP "\fBC-a i\fP"
452 .PD 0
453 .IP "\fBC-a C-i\fP      (info)"
455 Show info about this window.
456 .IP "\fBC-a k\fP"
457 .PD 0
458 .IP "\fBC-a C-k\fP      (kill)"
460 Destroy current window.
461 .IP "\fBC-a l\fP"
462 .PD 0
463 .IP "\fBC-a C-l\fP      (redisplay)"
465 Fully refresh current window.
466 .IP "\fBC-a L\fP        (login)"
467 Toggle this windows login slot. Available only if
468 .I screen
469 is configured to update the utmp database.
470 .IP "\fBC-a m\fP"
471 .PD 0
472 .IP "\fBC-a C-m\fP      (lastmsg)"
474 Repeat the last message displayed in the message line.
475 .IP "\fBC-a M\fP        (monitor)"
476 Toggles monitoring of the current window.
477 .IP "\fBC-a space\fP"
478 .PD 0
479 .IP "\fBC-a n\fP"
480 .IP "\fBC-a C-n\fP      (next)"
482 Switch to the next window.
483 .IP "\fBC-a N\fP        (number)"
484 Show the number (and title) of the current window.
485 .IP "\fBC-a backspace\fP"
486 .PD 0
487 .IP "\fBC-a h\fP"
488 .IP "\fBC-a p\fP"
489 .IP "\fBC-a C-p\fP      (prev)"
491 Switch to the previous window (opposite of \fBC-a n\fP).
492 .IP "\fBC-a q\fP"
493 .PD 0
494 .IP "\fBC-a C-q\fP      (xon)"
496 Send a control-q to the current window.
497 .IP "\fBC-a Q\fP        (only)"
498 Delete all regions but the current one.
499 See also \fIsplit, remove, focus\fP.
500 .IP "\fBC-a r\fP"
501 .PD 0
502 .IP "\fBC-a C-r\fP      (wrap)"
504 Toggle the current window's line-wrap setting (turn the current window's
505 automatic margins on and off).
506 .IP "\fBC-a s\fP"
507 .PD 0
508 .IP "\fBC-a C-s\fP      (xoff)"
510 Send a control-s to the current window.
511 .IP "\fBC-a S\fP        (split)"
512 Split the current region into two new ones.
513 See also \fIonly, remove, focus\fP.
514 .IP "\fBC-a t\fP"
515 .PD 0
516 .IP "\fBC-a C-t\fP      (time)"
518 Show system information.
519 .IP "\fBC-a v\fP        (version)"
521 Display the version and compilation date.
522 .IP "\fBC-a C-v\fP      (digraph)"
524 Enter digraph.
525 .IP "\fBC-a w\fP"
526 .PD 0
527 .IP "\fBC-a C-w\fP      (windows)"
529 Show a list of window.
530 .IP "\fBC-a W\fP        (width)"
531 Toggle 80/132 columns.
532 .IP "\fBC-a x\fP"
533 .PD 0
534 .IP "\fBC-a C-x\fP      (lockscreen)"
536 Lock this terminal.
537 .IP "\fBC-a X\fP        (remove)"
538 Kill the current region.
539 See also \fIsplit, only, focus\fP.
540 .IP "\fBC-a z\fP"
541 .PD 0
542 .IP "\fBC-a C-z\fP      (suspend)"
544 Suspend
545 .IR screen .
546 Your system must support BSD-style job-control.
547 .IP "\fBC-a Z\fP        (reset)"
548 Reset the virtual terminal to its \*Qpower-on\*U values.
549 .IP "\fBC-a .\fP        (dumptermcap)"
550 Write out a \*Q.termcap\*U file.
551 .IP "\fBC-a ?\fP        (help)"
552 Show key bindings.
553 .IP "\fBC-a C-\e\fP     (quit)"
554 Kill all windows and terminate
555 .IR screen .
556 .IP "\fBC-a :\fP        (colon)"
557 Enter command line mode.
558 .IP "\fBC-a [\fP"
559 .PD 0
560 .IP "\fBC-a C-[\fP"
561 .IP "\fBC-a esc\fP      (copy)"
563 Enter copy/scrollback mode.
564 .IP "\fBC-a ]\fP        (paste .)"
566 Write the contents of the paste buffer to the stdin queue of the
567 current window. 
568 .IP "\fBC-a {\fP
569 .PD 0
570 .IP "\fBC-a }\fP        (history)"
572 Copy and paste a previous (command) line.
573 .IP "\fBC-a >\fP        (writebuf)"
574 Write paste buffer to a file.
575 .IP "\fBC-a <\fP        (readbuf)"
576 Reads the screen-exchange file into the paste buffer.
577 .IP "\fBC-a =\fP        (removebuf)"
578 Removes the file used by \fBC-a <\fP and \fPC-a >\fP.
579 .IP "\fBC-a ,\fP        (license)"
580 Shows where
581 .I screen
582 comes from, where it went to and why you can use it.
583 .IP "\fBC-a _\fP        (silence)"
584 Start/stop monitoring the current window for inactivity.
585 .IP "\fBC-a *\fP        (displays)"
586 Show a listing of all currently attached displays.
589 .SH CUSTOMIZATION
590 The \*Qsocket directory\*U defaults either to $HOME/.screen or simply to
591 /tmp/screens or preferably to /usr/local/screens chosen at compile-time. If
592 .I screen
593 is installed setuid-root, then the administrator
594 should compile
595 .I screen
596 with an adequate (not NFS mounted) socket directory. If
597 .I screen
598 is not running setuid-root, the user can specify any mode 700 directory
599 in the environment variable $SCREENDIR.
601 When
602 .I screen
603 is invoked, it executes initialization commands from the files
604 \*Q/usr/local/etc/screenrc\*U and
605 \*Q.screenrc\*U in the user's home directory. These are the \*Qprogrammer's
606 defaults\*U that can be overridden in the following ways: for the
607 global screenrc file 
608 .I screen
609 searches for the environment variable $SYSSCREENRC (this override feature
610 may be disabled at compile-time). The user specific
611 screenrc file is searched in $SCREENRC, then $HOME/.screenrc.
612 The command line option \fB-c\fP takes
613 precedence over the above user screenrc files.
615 Commands in these files are used to set options, bind functions to
616 keys, and to automatically establish one or more windows at the
617 beginning of your
618 .I screen
619 session.
620 Commands are listed one per line, with empty lines being ignored.
621 A command's arguments are separated by tabs or spaces, and may be
622 surrounded by single or double quotes.
623 A `#' turns the rest of the line into a comment, except in quotes.
624 Unintelligible lines are warned about and ignored.
625 Commands may contain references to environment variables. The 
626 syntax is the shell-like "$VAR " or "${VAR}". Note that this causes 
627 incompatibility with previous 
628 .I screen
629 versions, as now the '$'-character has to be protected with '\e' if no
630 variable substitution shall be performed. A string in single-quotes is also
631 protected from variable substitution.
633 Two configuration files are shipped as examples with your screen distribution:
634 \*Qetc/screenrc\*U and \*Qetc/etcscreenrc\*U. They contain a number of
635 useful examples for various commands.
637 Customization can also be done 'on-line'. To enter the command mode type
638 `C-a :'. Note that commands starting with \*Qdef\*U change default values,
639 while others change current settings.
641 The following commands are available:
642 .sp 
643 .ne 3
644 .BI acladd " usernames"
645 .RI [ crypted-pw ]
647 .BI addacl " usernames"
649 Enable users to fully access this screen session. \fIUsernames\fP can be one
650 user or a comma separated list of users. This command enables to attach to the
651 .I screen
652 session and performs the equivalent of `aclchg \fIusernames\fP +rwx \&"#?\&"'.
653 executed. To add a user with restricted access, use the `aclchg' command below.
654 If an optional second parameter is supplied, it should be a crypted password
655 for the named user(s). `Addacl' is a synonym to `acladd'.
656 Multi user mode only.
657 .sp 
658 .ne 3
659 .BI aclchg " usernames permbits list"
661 .BI chacl " usernames permbits list"
663 Change permissions for a comma separated list of users. Permission bits are
664 represented as `r', `w' and `x'. Prefixing `+' grants the permission, `-' 
665 removes it. The third parameter is a comma separated list of commands and/or
666 windows (specified either by number or title). The special list `#' refers to 
667 all windows, `?' to all commands. if \fIusernames\fP consists of a single `*',
668 all known users are affected.
669 A command can be executed when the user has the `x' bit for it.
670 The user can type input to a window when he has its `w' bit set and no other
671 user obtains a writelock for this window. 
672 Other bits are currently ignored.  
673 To withdraw the writelock from another user in window 2:
674 `aclchg \fIusername\fP -w+w 2'.
675 To allow read-only access to the session: `aclchg \fIusername\fP
676 -w \&"#\&"'. As soon as a user's name is known to 
677 .I screen 
678 he can attach to the session and (per default) has full permissions for all 
679 command and windows. Execution permission for the acl commands, `at' and others
680 should also be removed or the user may be able to regain write permission.
681 Rights of the special username
682 .B nobody
683 cannot be changed (see the \*Qsu\*U command).
684 `Chacl' is a synonym to `aclchg'.
685 Multi user mode only.
687 .ne 3
688 .BI acldel " username"
690 Remove a user from
691 .IR screen 's
692 access control list. If currently attached, all the
693 user's displays are detached from the session. He cannot attach again.
694 Multi user mode only.
696 .ne 3
697 .BI aclgrp " username"
698 .RI [ groupname ]
700 Creates groups of users that share common access rights. The name of the 
701 group is the username of the group leader. Each member of the group inherits
702 the permissions that are granted to the group leader. That means, if a user
703 fails an access check, another check is made for the group leader.
704 A user is removed from all groups the special value \*Qnone\*U is used for
705 .IR groupname .
706 If the second parameter is omitted all groups the user is in are listed.
708 .ne 3
709 .B aclumask
710 .RI [[ users ] +bits 
711 .RI |[ users ] -bits " .... ]"
713 .B umask
714 .RI [[ users ] +bits 
715 .RI |[ users ] -bits " .... ]"
717 This specifies the access other users have to windows that will be created by
718 the caller of the command.
719 .I Users
720 may be no, one or a comma separated list of known usernames. If no users are
721 specified, a list of all currently known users is assumed. 
722 .I Bits
723 is any combination of access control bits allowed defined with the 
724 \*Qaclchg\*U command. The special username \*Q?\*U predefines the access
725 that not yet known users will be granted to any window initially.
726 The special username \*Q??\*U predefines the access that not yet known 
727 users are granted to any command. 
728 Rights of the special username
729 .B nobody
730 cannot be changed (see the \*Qsu\*U command).
731 `Umask' is a synonym to `aclumask'.
733 .ne 3
734 .BI activity " message"
736 When any activity occurs in a background window that is being monitored,
737 .I screen
738 displays a notification in the message line.
739 The notification message can be re-defined by means of the \*Qactivity\*U
740 command.
741 Each occurrence of `%' in \fImessage\fP is replaced by
742 the number of the window in which activity has occurred,
743 and each occurrence of `^G' is replaced by the definition for bell
744 in your termcap (usually an audible bell).
745 The default message is
747         'Activity in window %n'
749 Note that monitoring is off for all windows by default, but can be altered
750 by use of the \*Qmonitor\*U command (C-a M).
752 .ne 3
753 .BR "allpartial on" | off
755 If set to on, only the current cursor line is refreshed on window change.
756 This affects all windows and is useful for slow terminal lines. The 
757 previous setting of full/partial refresh for each window is restored
758 with \*Qallpartial off\*U.  This is a global flag that immediately takes effect
759 on all windows overriding the \*Qpartial\*U settings. It does not change the
760 default redraw behavior of newly created windows.
762 .ne 3
763 .BR "altscreen on" | off
765 If set to on, "alternate screen" support is enabled in virtual terminals,
766 just like in xterm.  Initial setting is `off'.
768 .ne 3
769 .BR "at " "[\fIidentifier\fP][" "#\fP|\fP*\fP|\fP%\fP] "
770 .IR "command " [ args " ... ]"
772 Execute a command at other displays or windows as if it had been entered there.
773 \*QAt\*U changes the context (the `current window' or `current display'
774 setting) of the command. If the first parameter describes a 
775 non-unique context, the command will be executed multiple times. If the first 
776 parameter is of the form `\fIidentifier\fP*' then identifier is matched against
777 user names.  The command is executed once for each display of the selected 
778 user(s). If the first parameter is of the form `\fIidentifier\fP%' identifier 
779 is matched against displays. Displays are named after the ttys they 
780 attach. The prefix `/dev/' or `/dev/tty' may be omitted from the identifier.
781 If \fIidentifier\fP has a `#' or nothing appended it is matched against 
782 window numbers and titles. Omitting an identifier in front of the `#', `*' or 
783 `%'-character selects all users, displays or windows because a prefix-match is
784 performed. Note that on the affected display(s) a short message will describe
785 what happened. Permission is checked for initiator of the \*Qat\*U command,
786 not for the owners of the affected display(s).
787 Note that the '#' character works as a comment introducer when it is preceded by
788 whitespace. This can be escaped by prefixing a '\e'. 
789 Permission is checked for the initiator of the \*Qat\*U command, not for the
790 owners of the affected display(s).
792 Caveat: 
793 When matching against windows, the command is executed at least 
794 once per window. Commands that change the internal arrangement of windows
795 (like \*Qother\*U) may be called again. In shared windows the command will
796 be repeated for each attached display. Beware, when issuing toggle commands
797 like \*Qlogin\*U!
798 Some commands (e.g. \*Qprocess\*U) require that 
799 a display is associated with the target windows.  These commands may not work
800 correctly under \*Qat\*U looping over windows.
802 .ne 3
803 .BI "attrcolor " attrib
804 .RI [ "attribute/color-modifier" ]
806 This command can be used to highlight attributes by changing the color of
807 the text. If the attribute
808 .I attrib
809 is in use, the specified attribute/color modifier is also applied. If no
810 modifier is given, the current one is deleted. See the \*QSTRING ESCAPES\*U
811 chapter for the syntax of the modifier. Screen understands two
812 pseudo-attributes, \*Qi\*U stands for high-intensity foreground
813 color and \*QI\*U for high-intensity background color.
815 Examples:
817 attrcolor b "R"
819 Change the color to bright red if bold text is to be printed.
821 attrcolor u "-u b"
823 Use blue text instead of underline.
825 attrcolor b ".I"
827 Use bright colors for bold text. Most terminal emulators do this
828 already.
830 attrcolor i "+b"
832 Make bright colored text also bold.
834 .ne 3
835 .BR "autodetach on" | off
837 Sets whether 
838 .I screen
839 will automatically detach upon hangup, which
840 saves all your running programs until they are resumed with a
841 .B "screen -r"
842 command.
843 When turned off, a hangup signal will terminate 
844 .I screen
845 and all the processes it contains. Autodetach is on by default.
847 .ne 3
848 .BR "autonuke on" | off
850 Sets whether a clear screen sequence should nuke all the output
851 that has not been written to the terminal. See also
852 \*Qobuflimit\*U.
854 .ne 3
855 .BI "backtick " id
856 .I lifespan
857 .I autorefresh
858 .I cmd
859 .I args...
861 .BI "backtick " id
863 Program the backtick command with the numerical id \fIid\fP.
864 The output of such a command is used for substitution of the
865 \*Q%`\*U string escape. The specified \fIlifespan\fP is the number
866 of seconds the output is considered valid. After this time, the
867 command is run again if a corresponding string escape is encountered.
868 The \fIautorefresh\fP parameter triggers an
869 automatic refresh for caption and hardstatus strings after the
870 specified number of seconds. Only the last line of output is used
871 for substitution.
873 If both the \fIlifespan\fP and the \fIautorefresh\fP parameters
874 are zero, the backtick program is expected to stay in the
875 background and generate output once in a while.
876 In this case, the command is executed right away and screen stores
877 the last line of output. If a new line gets printed screen will
878 automatically refresh the hardstatus or the captions.
880 The second form of the command deletes the backtick command
881 with the numerical id \fIid\fP.
883 .ne 3
884 .BR "bce " [ on | off ]
886 Change background-color-erase setting. If \*Qbce\*U is set to on, all
887 characters cleared by an erase/insert/scroll/clear operation
888 will be displayed in the current background color. Otherwise
889 the default background color is used.
891 .ne 3
892 .B bell_msg
893 .RI [ message ]
895 When a bell character is sent to a background window,
896 .I screen
897 displays a notification in the message line.
898 The notification message can be re-defined by this command.
899 Each occurrence of `%' in \fImessage\fP is replaced by
900 the number of the window to which a bell has been sent,
901 and each occurrence of `^G' is replaced by the definition for bell
902 in your termcap (usually an audible bell).
903 The default message is
905         'Bell in window %n'
907 An empty message can be supplied to the \*Qbell_msg\*U command to suppress
908 output of a message line (bell_msg "").
909 Without parameter, the current message is shown.
911 .ne 3
912 .BI "bind "
913 .RB [ -c
914 .IR class ]
915 .I key 
916 .RI [ command " [" args ]]
918 Bind a command to a key.
919 By default, most of the commands provided by
920 .I screen
921 are bound to one or more keys as indicated in the \*QDEFAULT KEY BINDINGS\*U
922 section, e.\|g. the
923 command to create a new window is bound to \*QC-c\*U and \*Qc\*U.
924 The \*Qbind\*U command can be used to redefine the key bindings and to
925 define new bindings.
926 The \fIkey\fP argument is either a single character, a two-character sequence
927 of the form \*Q^x\*U (meaning \*QC-x\*U), a backslash followed by an octal
928 number (specifying the ASCII code of the character), or a backslash followed
929 by a second character, such as \*Q\e^\*U or \*Q\e\e\*U.
930 The argument can also be quoted, if you like.
931 If no further argument is given, any previously established binding
932 for this key is removed.
933 The \fIcommand\fP argument can be any command listed in this section.
935 If a command class is specified via the \*Q-c\*U option, the key
936 is bound for the specified class. Use the \*Qcommand\*U command
937 to activate a class. Command classes can be used to create multiple
938 command keys or multi-character bindings.
940 Some examples:
943         bind ' ' windows
944         bind ^k
945         bind k
946         bind K kill
947         bind ^f screen telnet foobar
948         bind \e033 screen -ln -t root -h 1000 9 su
951 would bind the space key to the command that displays a list
952 of windows (so that the command usually invoked by \*QC-a C-w\*U
953 would also be available as \*QC-a space\*U). The next three lines
954 remove the default kill binding from \*QC-a C-k\*U and \*QC-a k\*U. 
955 \*QC-a K\*U is then bound to the kill command. Then it
956 binds \*QC-f\*U to the command \*Qcreate a window with a TELNET
957 connection to foobar\*U, and bind \*Qescape\*U to the command
958 that creates an non-login window with a.\|k.\|a. \*Qroot\*U in slot #9, with
959 a superuser shell and a scrollback buffer of 1000 lines.
962         bind -c demo1 0 select 10
963         bind -c demo1 1 select 11
964         bind -c demo1 2 select 12
965         bindkey "^B" command -c demo1
968 makes \*QC-b 0\*U select window 10, \*QC-b 1\*U window 11, etc.
971         bind -c demo2 0 select 10
972         bind -c demo2 1 select 11
973         bind -c demo2 2 select 12
974         bind - command -c demo2
977 makes \*QC-a - 0\*U select window 10, \*QC-a - 1\*U window 11, etc.
979 .ne 3
980 .B bindkey
981 .RB [ -d ]
982 .RB [ -m ]
983 .RB [ -a ]
984 .RB [[ -k | -t ]
985 .I string
986 .RI [ "cmd args" ]]
988 This command manages screen's input translation tables. Every
989 entry in one of the tables tells screen how to react if a certain
990 sequence of characters is encountered. There are three tables:
991 one that should contain actions programmed by the user, one for
992 the default actions used for terminal emulation and one for
993 screen's copy mode to do cursor movement. See section
994 \*QINPUT TRANSLATION\*U for a list of default key bindings.
996 If the
997 .B -d
998 option is given, bindkey modifies the default table,
999 .B -m
1000 changes the copy mode table
1001 and with neither option the user table is selected.
1002 The argument
1003 .I string
1004 is the sequence of characters to which an action is bound. This
1005 can either be a fixed string or a termcap keyboard capability
1006 name (selectable with the
1007 .B -k
1008 option).
1010 Some keys on a VT100 terminal can send a different
1011 string if application mode is turned on (e.g the cursor keys).
1012 Such keys have two entries in the translation table. You can
1013 select the application mode entry by specifying the
1014 .B -a
1015 option.
1018 .B -t
1019 option tells screen not to do inter-character timing. One cannot
1020 turn off the timing if a termcap capability is used.
1022 .I Cmd
1023 can be any of screen's commands with an arbitrary number of
1024 .IR args .
1026 .I cmd
1027 is omitted the key-binding is removed from the table.
1029 Here are some examples of keyboard bindings:
1032         bindkey -d
1034 Show all of the default key bindings. The application mode entries
1035 are marked with [A].
1038         bindkey -k k1 select 1
1040 Make the "F1" key switch to window one.
1043         bindkey -t foo stuff barfoo
1045 Make "foo" an abbreviation of the word "barfoo". Timeout is disabled
1046 so that users can type slowly.
1049         bindkey "\e024" mapdefault
1051 This key-binding makes \*Q^T\*U an escape character for key-bindings. If
1052 you did the above \*Qstuff barfoo\*U binding, you can enter the word
1053 \*Qfoo\*U by typing \*Q^Tfoo\*U. If you want to insert a \*Q^T\*U
1054 you have to press the key twice (i.e., escape the escape binding).
1057         bindkey -k F1 command
1059 Make the F11 (not F1!) key an alternative screen
1060 escape (besides ^A).
1062 .ne 3
1063 .B break
1064 .RI [ duration ]
1066 Send a break signal for \fIduration\fP*0.25 seconds to this window.
1067 For non-Posix systems the time interval may be rounded up to full seconds.
1068 Most useful if a character device is attached to the window rather than 
1069 a shell process (See also chapter \*QWINDOW TYPES\*U). The maximum duration of
1070 a break signal is limited to 15 seconds.
1072 .ne 3
1073 .B blanker
1075 Activate the screen blanker. First the screen is cleared. If no blanker
1076 program is defined, the cursor is turned off, otherwise, the 
1077 program is started and it's output is written to the screen.
1078 The screen blanker is killed with the first keypress, the read key
1079 is discarded.
1081 This command is normally used together with the \*Qidle\*U command.
1083 .ne 3
1084 .B blankerprg
1085 .RI [ "program args" ]
1087 Defines a blanker program. Disables the blanker program if no
1088 arguments are given.
1090 .ne 3
1091 .B breaktype
1092 .RI [ tcsendbreak | TIOCSBRK
1093 .RI | TCSBRK ]
1095 Choose one of the available methods of generating a break signal for
1096 terminal devices. This command should affect the current window only.
1097 But it still behaves identical to \*Qdefbreaktype\*U. This will be changed in
1098 the future.
1099 Calling \*Qbreaktype\*U with no parameter displays the break method for the
1100 current window.
1102 .ne 3
1103 .B bufferfile
1104 .RI [ exchange-file ]
1106 Change the filename used for reading and writing with the paste buffer.
1107 If the optional argument to the \*Qbufferfile\*U command is omitted, 
1108 the default setting (\*Q/tmp/screen-exchange\*U) is reactivated.
1109 The following example will paste the system's password file into 
1111 .I screen
1112 window (using the paste buffer, where a copy remains):
1115         C-a : bufferfile /etc/passwd
1116         C-a < C-a ]
1117         C-a : bufferfile
1120 .ne 3
1121 .BR "c1 " [ on | off ]
1123 Change c1 code processing. \*QC1 on\*U tells screen to treat
1124 the input characters between 128 and 159 as control functions.
1125 Such an 8-bit code is normally the same as ESC followed by the
1126 corresponding 7-bit code. The default setting is to process c1
1127 codes and can be changed with the \*Qdefc1\*U command. 
1128 Users with fonts that have usable characters in the
1129 c1 positions may want to turn this off.
1131 .ne 3
1132 .BR "caption always" | splitonly
1133 .RI [ string ]
1135 .B "caption string"
1136 .RI [ string ]
1138 This command controls the display of the window captions. Normally
1139 a caption is only used if more than one window is shown on the
1140 display (split screen mode). But if the type is set to
1141 .B always
1142 screen shows a caption even if only one window is displayed. The default
1144 .BR splitonly .
1146 The second form changes the text used for the caption. You can use
1147 all escapes from the \*QSTRING ESCAPES\*U chapter. Screen uses
1148 a default of `%3n %t'.
1150 You can mix both forms by providing a string as an additional argument.
1152 .ne 3
1153 .BI "charset " set
1155 Change the current character set slot designation and charset
1156 mapping.  The first four character of
1157 .I set
1158 are treated as charset designators while the fifth and sixth
1159 character must be in range '0' to '3' and set the GL/GR charset
1160 mapping. On every position a '.' may be used to indicate that
1161 the corresponding charset/mapping should not be changed
1162 (\fIset\fP is padded to six characters internally by appending '.'
1163 chars). New windows have "BBBB02" as default charset, unless a
1164 \*Qencoding\*U command is active.
1166 The current setting can be viewed with the \*Qinfo\*U command.
1168 .ne 3
1169 .B chdir
1170 .RI [ directory ]
1172 Change the \fIcurrent directory\fP of
1173 .I screen
1174 to the specified directory or, if called without an argument,
1175 to your home directory (the value of the environment variable $HOME).
1176 All windows that are created by means of the \*Qscreen\*U command
1177 from within \*Q.screenrc\*U or by means of \*QC-a : screen ...\*U
1178 or \*QC-a c\*U use this as their default directory.
1179 Without a chdir command, this would be the directory from which
1180 .I screen
1181 was invoked.
1182 Hardcopy and log files are always written to the \fIwindow's\fP default
1183 directory, \fInot\fP the current directory of the process running in the
1184 window.
1185 You can use this command multiple times in your .screenrc to start various
1186 windows in different default directories, but the last chdir value will
1187 affect all the windows you create interactively.
1189 .ne 3
1190 .B clear
1192 Clears the current window and saves its image to the scrollback buffer.
1194 .ne 3
1195 .B colon
1196 .RI [ prefix ]
1198 Allows you to enter \*Q.screenrc\*U command lines. Useful 
1199 for on-the-fly modification of key bindings, 
1200 specific window creation and changing settings. Note that the \*Qset\*U
1201 keyword no longer exists! Usually commands affect the current window rather 
1202 than default settings for future windows. Change defaults with commands
1203 starting with 'def...'. 
1205 If you consider this as the `Ex command mode' of 
1206 .IR screen ,
1207 you may regard \*QC-a esc\*U (copy mode) as its `Vi command mode'.
1208 .sp 
1209 .ne 3
1210 .B command
1211 .RB [ -c
1212 .IR class ]
1214 This command has the same effect as typing the screen escape
1215 character (^A). It is probably only useful for key bindings.
1216 If the \*Q-c\*U option is given, select the specified command
1217 class.  See also \*Qbind\*U and \*Qbindkey\*U.
1218 .sp 
1219 .ne 3
1220 .BR "compacthist " [ on | off ]
1222 This tells screen whether to suppress trailing blank lines when
1223 scrolling up text into the history buffer.
1224 .sp 
1225 .ne 3
1226 .BR "console " [ on | off ]
1228 Grabs or un-grabs the machines console output to a window.
1229 .IR Note :
1230 Only the owner of /dev/console can grab the console output.
1231 This command is only available if the machine supports the ioctl TIOCCONS.
1233 .ne 3
1234 .B copy
1236 Enter copy/scrollback mode. This allows you to copy text from the current
1237 window and its history into the paste buffer. In this mode a vi-like
1238 `full screen editor' is active:
1240 .IR "Movement keys" :
1242 .in +4n
1243 .ti -2n
1244 \fBh\fP, \fBj\fP, \fBk\fP, \fBl\fP move the cursor line by line or 
1245 column by column.
1247 .ti -2n
1248 \fB0\fP, \fB^\fP and \fB$\fP move to the leftmost column, to the first or last
1249 non-whitespace character on the line.
1251 .ti -2n
1252 \fBH\fP, \fBM\fP and \fBL\fP move the cursor to the leftmost column
1253 of the top, center or bottom line of the window. 
1255 .ti -2n
1256 \fB+\fP and \fB\-\fP positions one line up and down.
1258 .ti -2n
1259 \fBG\fP moves to the specified absolute line (default: end of buffer).
1260 .br 
1261 .ti -2n
1262 \fB|\fP moves to the specified absolute column.
1264 .ti -2n
1265 \fBw\fP, \fBb\fP, \fBe\fP move the cursor word by word.
1266 .br 
1267 .ti -2n
1268 \fBB\fP, \fBE\fP move the cursor WORD by WORD (as in vi).
1269 .br 
1270 .ti -2n
1271 .\"\fBf\fP,\fBt\fP, \fBF\fP, \fBT\fP move the cursor forward/backward to the next occurence of the target.
1272 \fBf/F\fP, \fBt/T\fP move the cursor forward/backward to the next occurence of the target. (eg, '3fy' will 
1273 move the cursor to the 3rd 'y' to the right.)
1275 .ti -2n
1276 \fB;\fP \fB,\fP Repeat the last f/F/t/T command in the same/opposite direction.
1278 .ti -2n
1279 \fBC-u\fP and \fBC-d\fP scroll the display up/down by the specified amount of 
1280 lines while preserving the cursor position. (Default: half screen-full). 
1282 .ti -2n
1283 \fBC-b\fP and \fBC-f\fP scroll the display up/down a full screen.
1285 .ti -2n
1286 \fBg\fP moves to the beginning of the buffer.
1288 .ti -2n
1289 \fB%\fP jumps to the specified percentage of the buffer.
1291 .ti -4n
1293 .IR Note :
1295 Emacs style movement keys can be customized by a .screenrc command.
1296 (E.\|g. markkeys "h=^B:l=^F:$=^E") There is no simple method for a full 
1297 emacs-style keymap, as this involves multi-character codes.
1300 .ti -4n
1301 .IR Marking :
1303 The copy range is specified by setting two marks. The text between these marks 
1304 will be highlighted. Press 
1306 .ti -2n
1307 \fBspace\fP to set the first or second mark
1308 respectively.
1310 .ti -2n
1311 \fBY\fP and \fBy\fP used to mark one whole line or to mark from 
1312 start of line.
1314 .ti -2n
1315 \fBW\fP marks exactly one word. 
1316 .br 
1317 .ti -4n
1318 .IR "Repeat count" :
1320 Any of these commands can be prefixed with a repeat count number by pressing 
1321 digits 
1323 .ti -2n
1324 \fB0\fP..\fB9\fP which
1325 is taken as a repeat count. 
1327 Example: \*QC-a C-[ H 10 j 5 Y\*U will copy lines
1328 11 to 15 into the paste buffer.
1330 .ti -4n
1331 .IR Searching :
1332 .ti -2n
1333 \fB/\fP \fIVi\fP-like search forward.
1334 .ti -2n
1335 \fB?\fP \fIVi\fP-like search backward.
1336 .ti -2n 
1337 \fBC-a s\fP \fIEmacs\fP style incremental search forward.
1338 .ti -2n
1339 \fBC-r\fP \fIEmacs\fP style reverse i-search.
1340 .ti -4n
1341 .IR Specials :
1343 There are however some keys that act differently than in
1344 .IR vi .
1345 .I Vi
1346 does not allow one to yank rectangular blocks of text, but
1347 .I screen
1348 does. Press 
1350 .ti -2n
1351 \fBc\fP or \fBC\fP to set the left or right margin respectively. If no repeat count is
1352 given, both default to the current cursor position. 
1354 Example: Try this on a rather full text screen: 
1355 \*QC-a [ M 20 l SPACE c 10 l 5 j C SPACE\*U.
1357 This moves one to the middle line of the screen, moves in 20 columns left,
1358 marks the beginning of the paste buffer, sets the left column, moves 5 columns
1359 down, sets the right column, and then marks the end of
1360 the paste buffer. Now try:
1362 \*QC-a [ M 20 l SPACE 10 l 5 j SPACE\*U
1364 and notice the difference in the amount of text copied.
1366 .ti -2n
1367 \fBJ\fP joins lines. It toggles between 4 modes: lines separated by a
1368 newline character (012), lines glued seamless, lines separated by a single
1369 whitespace and comma separated lines. Note that you can prepend the newline
1370 character with a carriage return character, by issuing a \*Qcrlf on\*U.
1372 .ti -2n
1373 \fBv\fP is for all the
1374 .I vi 
1375 users with \*Q:set numbers\*U \- it toggles the left margin between column 9
1376 and 1. Press 
1378 .ti -2n
1379 \fBa\fP before the final space key to toggle in append mode. Thus
1380 the contents of the paste buffer will not be overwritten, but is appended to.
1382 .ti -2n
1383 \fBA\fP toggles in append mode and sets a (second) mark.
1385 .ti -2n
1386 \fB>\fP sets the (second) mark and writes the contents of the paste buffer to
1387 the screen-exchange file (/tmp/screen-exchange per default) once copy-mode is 
1388 finished. 
1390 This example demonstrates how to dump the whole scrollback buffer 
1391 to that file: \*QC-A [ g SPACE G $ >\*U.
1393 .ti -2n
1394 \fBC-g\fP gives information about the current line and column.
1396 .ti -2n
1397 \fBx\fP exchanges the first mark and the current cursor position. You
1398 can use this to adjust an already placed mark.
1400 .ti -2n
1401 \fB@\fP does nothing. Does not even exit copy mode.
1403 .ti -2n
1404 All keys not described here exit copy mode.
1405 .in -4n
1407 .ne 3
1408 .B copy_reg
1409 .RI [ key ]
1411 No longer exists, use \*Qreadreg\*U instead.
1413 .ne 3
1414 .BR "crlf " [ on | off ]
1416 This affects the copying of text regions with the `C-a [' command. If it is set
1417 to `on', lines will be separated by the two character sequence `CR' - `LF'. 
1418 Otherwise (default) only `LF' is used.
1419 When no parameter is given, the state is toggled.
1421 .ne 3
1422 .BR "debug on" | off
1424 Turns runtime debugging on or off. If 
1425 .I screen
1426 has been compiled with option -DDEBUG debugging available and is turned on per 
1427 default. Note that this command only affects debugging output from the main 
1428 \*QSCREEN\*U process correctly. Debug output from attacher processes can only
1429 be turned off once and forever.
1431 .ne 3
1432 .BR "defc1 on" | off
1434 Same as the \fBc1\fP command except that the default setting for new
1435 windows is changed. Initial setting is `on'.
1437 .ne 3
1438 .BR "defautonuke on" | off
1440 Same as the \fBautonuke\fP command except that the default setting for new displays is changed. Initial setting is `off'.
1441 Note that you can use the special `AN' terminal capability if you
1442 want to have a dependency on the terminal type.
1444 .ne 3
1445 .BR "defbce on" | off
1447 Same as the \fBbce\fP command except that the default setting for new
1448 windows is changed. Initial setting is `off'.
1450 .ne 3
1451 .B defbreaktype
1452 .RI [ tcsendbreak | TIOCSBRK
1453 .RI | TCSBRK ]
1455 Choose one of the available methods of generating a break signal for
1456 terminal devices. The preferred methods are 
1457 .IR tcsendbreak " and " TIOCSBRK .
1458 The third, 
1459 .IR TCSBRK , 
1460 blocks the complete 
1461 .I screen
1462 session for the duration
1463 of the break, but it may be the only way to generate long breaks. 
1464 .IR Tcsendbreak " and " TIOCSBRK
1465 may or may not produce long breaks with spikes (e.g. 4 per
1466 second). This is not only system-dependent, this also differs between
1467 serial board drivers.
1468 Calling \*Qdefbreaktype\*U with no parameter displays the current setting.
1470 .ne 3
1471 .BR "defcharset " [ \fIset ]
1473 Like the \fBcharset\fP command except that the default setting for
1474 new windows is changed. Shows current default if called without
1475 argument.
1477 .ne 3
1478 .BI "defescape " xy
1480 Set the default command characters. This is equivalent to the 
1481 \*Qescape\*U except that it is useful multiuser sessions only. In a
1482 multiuser session \*Qescape\*U changes the command character of the
1483 calling user, where \*Qdefescape\*U changes the default command
1484 characters for users that will be added later.
1486 .ne 3
1487 .BR "defflow on" | off | auto 
1488 .RB [ interrupt ]
1490 Same as the \fBflow\fP command except that the default setting for new windows 
1491 is changed. Initial setting is `auto'.
1492 Specifying \*Qdefflow auto interrupt\*U is the same as the command-line options
1493 .B \-fa
1495 .BR \-i . 
1497 .ne 3
1498 .BR "defgr on" | off
1500 Same as the \fBgr\fP command except that the default setting for new
1501 windows is changed. Initial setting is `off'.
1503 .ne 3
1504 .BR "defhstatus " [ \fIstatus ]
1506 The hardstatus line that all new windows will get is set to
1507 .I status\fR.
1508 This command is useful to make the hardstatus of every window
1509 display the window number or title or the like.
1510 .I Status
1511 may contain the same directives as in the window messages, but
1512 the directive escape character is '^E' (octal 005) instead of '%'.
1513 This was done to make a misinterpretation of program generated
1514 hardstatus lines impossible.
1515 If the parameter
1516 .I status
1517 is omitted, the current default string is displayed.
1518 Per default the hardstatus line of new windows is empty.
1520 .ne 3
1521 .BI "defencoding " enc
1523 Same as the \fBencoding\fP command except that the default setting for new
1524 windows is changed. Initial setting is the encoding taken from the
1525 terminal.
1527 .ne 3
1528 .BR "deflog on" | off
1530 Same as the \fBlog\fP command except that the default setting for new windows 
1531 is changed. Initial setting is `off'.
1533 .ne 3
1534 .BR "deflogin on" | off
1536 Same as the \fBlogin\fP command except that the default setting for new windows 
1537 is changed. This is initialized with `on' as distributed (see config.h.in).
1539 .ne 3
1540 .BI "defmode " mode
1542 The mode of each newly allocated pseudo-tty is set to \fImode\fP.
1543 \fIMode\fP is an octal number.
1544 When no \*Qdefmode\*U command is given, mode 0622 is used.
1546 .ne 3
1547 .BR "defmonitor on" | off
1549 Same as the \fBmonitor\fP command except that the default setting for new 
1550 windows is changed. Initial setting is `off'.
1552 .ne 3
1553 .B defnonblock 
1554 .BR on | off | \fInumsecs
1556 Same as the \fBnonblock\fP command except that the default setting for
1557 displays is changed. Initial setting is `off'.
1559 .ne 3
1560 .BI "defobuflimit " limit
1562 Same as the \fBobuflimit\fP command except that the default setting for new displays is changed. Initial setting is 256 bytes.
1563 Note that you can use the special 'OL' terminal capability if you
1564 want to have a dependency on the terminal type.
1566 .ne 3
1567 .BI "defscrollback " num
1569 Same as the \fBscrollback\fP command except that the default setting for new 
1570 windows is changed. Initial setting is 100.
1572 .ne 3
1573 .BI "defshell " command
1575 Synonym to the \fBshell\fP command. See there.
1577 .ne 3
1578 .BR "defsilence on" | off
1580 Same as the \fBsilence\fP command except that the default setting for new
1581 windows is changed. Initial setting is `off'.
1583 .ne 3
1584 .BI "defslowpaste " msec"
1586 Same as the \fBslowpaste\fP command except that the default setting for new
1587 windows is changed. Initial setting is 0 milliseconds, meaning `off'.
1589 .ne 3
1590 .BR "defutf8 on" | off
1592 Same as the \fButf8\fP command except that the default setting for new
1593 windows is changed. Initial setting is `on' if screen was started with
1594 \*Q-U\*U, otherwise `off'.
1596 .ne 3
1597 .BR "defwrap on" | off
1599 Same as the \fBwrap\fP command except that the default setting for new 
1600 windows is changed. Initially line-wrap is on and can be toggled with the 
1601 \*Qwrap\*U command (\*QC-a r\*U) or by means of "C-a : wrap on|off".
1603 .ne 3
1604 .BR "defwritelock on" | off | auto
1606 Same as the \fBwritelock\fP command except that the default setting for new 
1607 windows is changed. Initially writelocks will off.
1609 .ne 3
1610 .BR "defzombie " [\fIkeys\fP]
1612 Synonym to the \fBzombie\fP command. Both currently change the default.
1613 See there.
1615 .ne 3
1616 .B detach
1617 .RB [ -h ]
1619 Detach the 
1620 .I screen
1621 session (disconnect it from the terminal and put it into the background).
1622 This returns you to the shell where you invoked
1623 .IR screen .
1624 A detached
1625 .I screen
1626 can be resumed by invoking
1627 .I screen
1628 with the
1629 .B \-r
1630 option (see also section \*QCOMMAND-LINE OPTIONS\*U). The
1631 .B \-h
1632 option tells screen to immediately close the connection to the
1633 terminal (\*Qhangup\*U).
1635 .ne 3
1636 .B dinfo
1638 Show what screen thinks about your terminal. Useful if you want to know
1639 why features like color or the alternate charset don't work.
1641 .ne 3
1642 .B displays
1644 Shows a tabular listing of all currently connected user front-ends (displays).
1645 This is most useful for multiuser sessions.
1647 .ne 3
1648 .BR "digraph " [ \fIpreset ]
1650 This command prompts the user for a digraph sequence. The next
1651 two characters typed are looked up in a builtin table and the
1652 resulting character is inserted in the input stream. For example,
1653 if the user enters 'a"', an a-umlaut will be inserted. If the
1654 first character entered is a 0 (zero),
1655 .I screen
1656 will treat the following characters (up to three) as an octal
1657 number instead.  The optional argument
1658 .I preset
1659 is treated as user input, thus one can create an \*Qumlaut\*U key.
1660 For example the command "bindkey ^K digraph '"'" enables the user
1661 to generate an a-umlaut by typing CTRL-K a.
1663 .ne 3
1664 .B dumptermcap
1666 Write the termcap entry for the virtual terminal optimized for the currently
1667 active window to the file \*Q.termcap\*U in the user's 
1668 \*Q$HOME/.screen\*U directory (or wherever 
1669 .I screen
1670 stores its sockets. See the \*QFILES\*U section below).
1671 This termcap entry is identical to the value of the environment variable
1672 $TERMCAP that is set up by
1673 .I screen
1674 for each window. For terminfo based systems you will need to run a converter
1675 like 
1676 .IR captoinfo
1677 and then compile the entry with 
1678 .IR tic .
1680 .ne 3
1681 .BR "echo " [ -n ]
1682 .I message
1684 The echo command may be used to annoy 
1685 .I screen
1686 users with a 'message of the
1687 day'. Typically installed in a global /local/etc/screenrc. 
1688 The option \*Q-n\*U may be used to suppress the line feed.
1689 See also \*Qsleep\*U.
1690 Echo is also useful for online checking of environment variables.
1692 .ne 3
1693 .BI "encoding " enc
1694 .RI [ enc ]
1696 Tell 
1697 .I screen 
1698 how to interpret the input/output. The first argument
1699 sets the encoding of the current window. Each window can emulate
1700 a different encoding. The optional second parameter overwrites
1701 the encoding of the connected terminal. It should never be
1702 needed as screen uses the locale setting to detect the encoding.
1703 There is also a way to select a terminal encoding depending on
1704 the terminal type by using the \*QKJ\*U termcap entry.
1706 Supported encodings are eucJP, SJIS, eucKR, eucCN, Big5, GBK, KOI8-R,
1707 CP1251, UTF-8, ISO8859-2, ISO8859-3, ISO8859-4, ISO8859-5, ISO8859-6,
1708 ISO8859-7, ISO8859-8, ISO8859-9, ISO8859-10, ISO8859-15, jis.
1710 See also \*Qdefencoding\*U, which changes the default setting of a new
1711 window.
1713 .ne 3
1714 .BI "escape " xy
1716 Set the command character to \fIx\fP and the character generating a literal
1717 command character (by triggering the \*Qmeta\*U command) to \fIy\fP (similar
1718 to the \-e option).
1719 Each argument is either a single character, a two-character sequence
1720 of the form \*Q^x\*U (meaning \*QC-x\*U), a backslash followed by an octal
1721 number (specifying the ASCII code of the character), or a backslash followed
1722 by a second character, such as \*Q\e^\*U or \*Q\e\e\*U.
1723 The default is \*Q^Aa\*U.
1725 .ne 3
1726 .B eval
1727 .I command1
1728 .RI [ command2
1729 .IR ... ]
1731 Parses and executes each argument as separate command.
1733 .ne 3
1734 .B exec
1735 .RI [[ fdpat ]
1736 .IR "newcommand " [ "args ..." ]]
1738 Run a unix subprocess (specified by an executable path \fInewcommand\fP and its 
1739 optional arguments) in the current window. The flow of data between 
1740 newcommands stdin/stdout/stderr, the process originally started in the window 
1741 (let us call it "application-process") and screen itself (window) is 
1742 controlled by the file descriptor pattern fdpat.
1743 This pattern is basically a three character sequence representing stdin, stdout
1744 and stderr of newcommand. A dot (.) connects the file descriptor
1746 .IR screen .
1747 An exclamation mark (!) causes the file
1748 descriptor to be connected to the application-process. A colon (:) combines
1749 both.
1750 User input will go to newcommand unless newcommand receives the 
1751 application-process' 
1752 output (fdpats first character is `!' or `:') or a pipe symbol (|) is added 
1753 (as a fourth character) to the end of fdpat.
1755 Invoking `exec' without arguments shows name and arguments of the currently
1756 running subprocess in this window. Only one subprocess a time can be running
1757 in each window.
1759 When a subprocess is running the `kill' command will affect it instead of the
1760 windows process.
1762 Refer to the postscript file `doc/fdpat.ps' for a confusing illustration
1763 of all 21 possible combinations. Each drawing shows the digits 2,1,0
1764 representing the three file descriptors of newcommand. The box marked
1765 `W' is the usual pty that has the application-process on its slave side.
1766 The box marked `P' is the secondary pty that now has
1767 .I screen
1768 at its master side.
1770 Abbreviations: 
1772 Whitespace between the word `exec' and fdpat and the command 
1773 can be omitted. Trailing dots and a fdpat consisting only of dots can be 
1774 omitted. A simple `|' is synonymous for the pattern `!..|'; the word exec can
1775 be omitted here and can always be replaced by `!'.
1777 Examples:
1779 exec ... /bin/sh
1781 exec /bin/sh
1783 !/bin/sh
1785 Creates another shell in the same window, while the original shell is still 
1786 running. Output of both shells is displayed and user input is sent to the new
1787 /bin/sh.
1789 exec !.. stty 19200
1791 exec ! stty 19200
1793 !!stty 19200
1795 Set the speed of the window's tty. If your stty command operates on stdout, 
1796 then add another `!'.
1798 exec !..| less
1800 |less
1802 This adds a pager to the window output. The special character `|' is needed to
1803 give the user control over the pager although it gets its input from the 
1804 window's process. This works, because
1805 .I less
1806 listens on stderr (a behavior that
1807 .I screen
1808 would not expect without the `|') 
1809 when its stdin is not a tty. 
1810 .I Less 
1811 versions newer than 177 fail miserably here; good old
1812 .I pg
1813 still works.
1815 !:sed -n s/.*Error.*/\e007/p
1817 Sends window output to both, the user and the sed command. The sed inserts an
1818 additional bell character (oct. 007) to the window output seen by
1819 .IR screen .
1820 This will cause "Bell in window x" messages, whenever the string "Error"
1821 appears in the window.
1823 .ne 3
1824 .B fit
1826 Change the window size to the size of the current region. This
1827 command is needed because screen doesn't adapt the window size
1828 automatically if the window is displayed more than once.
1830 .ne 3
1831 .B flow
1832 .RB [ on | off | "auto\fR]\fP"
1834 Sets the flow-control mode for this window.
1835 Without parameters it cycles the current window's flow-control setting from 
1836 "automatic" to "on" to "off".
1837 See the discussion on \*QFLOW-CONTROL\*U later on in this document for full 
1838 details and note, that this is subject to change in future releases.
1839 Default is set by `defflow'.
1841 .ne 3
1842 .BR "focus " [ up | down | top | bottom ]
1844 Move the input focus to the next region. This is done in a cyclic
1845 way so that the top region is selected after the bottom one. If
1846 no subcommand is given it defaults to `down'. `up' cycles in the
1847 opposite order, `top' and `bottom' go to the top and bottom
1848 region respectively. Useful bindings are (j and k as in vi)
1850     bind j focus down
1851     bind k focus up
1852     bind t focus top
1853     bind b focus bottom
1855 Note that \fBk\fP is traditionally bound to the \fIkill\fP command.
1857 .ne 3
1858 .BR "gr " [ on | off ]
1860 Turn GR charset switching on/off. Whenever screen sees an input
1861 character with the 8th bit set, it will use the charset stored in the
1862 GR slot and print the character with the 8th bit stripped. The
1863 default (see also \*Qdefgr\*U) is not to process GR switching because
1864 otherwise the ISO88591 charset would not work.
1866 .ne 3
1867 .B hardcopy
1868 .RB [ -h ]
1869 .RI [ file ]
1871 Writes out the currently displayed image to the file \fIfile\fP,
1872 or, if no filename is specified, to \fIhardcopy.n\fP in the
1873 default directory, where \fIn\fP is the number of the current window. 
1874 This either appends or overwrites the file if it exists. See below.
1875 If the option \fB-h\fP is specified, dump also the contents of the
1876 scrollback buffer.
1878 .ne 3
1879 .BR "hardcopy_append on" | off
1881 If set to "on", 
1882 .I screen
1883 will append to the "hardcopy.n" files created by the command \*QC-a h\*U, 
1884 otherwise these files are overwritten each time.
1885 Default is `off'.
1887 .ne 3
1888 .BI "hardcopydir "directory
1890 Defines a directory where hardcopy files will be placed. If unset, hardcopys
1891 are dumped in
1892 .IR screen 's
1893 current working directory.
1895 .ne 3
1896 .BR "hardstatus " [ on | off ]
1898 .BR "hardstatus \fR[\fBalways\fR]\fBlastline" | message | ignore
1899 .RI [ string ]
1901 .B "hardstatus string"
1902 .RI [ string ]
1904 This command configures the use and emulation of the terminal's
1905 hardstatus line. The first form
1906 toggles whether
1907 .I screen
1908 will use the hardware status line to display messages. If the
1909 flag is set to `off', these messages
1910 are overlaid in reverse video mode at the display line. The default
1911 setting is `on'.
1913 The second form tells 
1914 .I screen 
1915 what to do if the terminal doesn't
1916 have a hardstatus line (i.e. the termcap/terminfo capabilities
1917 "hs", "ts", "fs" and "ds" are not set). If the type
1918 \*Qlastline\*U is used, 
1919 .I screen 
1920 will reserve the last line of the
1921 display for
1922 the hardstatus. \*Qmessage\*U uses 
1923 .I screen's
1924 message mechanism and
1925 \*Qignore\*U tells 
1926 .I screen 
1927 never to display the hardstatus.
1928 If you prepend the word \*Qalways\*U to the type (e.g., \*Qalwayslastline\*U), 
1929 .I screen 
1930 will use the type even if the terminal supports a hardstatus.
1932 The third form specifies the contents of the hardstatus line.  '%h' is
1933 used as default string, i.e., the stored hardstatus of the current
1934 window (settable via \*QESC]0;<string>^G\*U or \*QESC_<string>ESC\e\*U)
1935 is displayed.  You can customize this to any string you like including
1936 the escapes from the \*QSTRING ESCAPES\*U chapter. If you leave out
1937 the argument
1938 .IR string ,
1939 the current string is displayed.
1941 You can mix the second and third form by providing the string as
1942 additional argument.
1944 .ne 3
1945 .B height
1946 .RB [ -w | -d ]
1947 .RI [ lines " [" cols ]]
1949 Set the display height to a specified number of lines. When no argument
1950 is given it toggles between 24 and 42 lines display. You can also
1951 specify a width if you want to change both values.
1953 .B -w
1954 option tells screen to leave the display size unchanged and just set
1955 the window size,
1956 .B -d
1957 vice versa.
1959 .ne 3
1960 .B help
1961 .RB [ -c
1962 .IR class ]
1964 Not really a online help, but 
1965 displays a help 
1966 .I screen 
1967 showing you all the key bindings.
1968 The first pages list all the internal commands followed by their current
1969 bindings.
1970 Subsequent pages will display the custom commands, one command per key.
1971 Press space when you're done reading each page, or return to exit early.
1972 All other characters are ignored. If the \*Q-c\*U option is given,
1973 display all bound commands for the specified command class.
1974 See also \*QDEFAULT KEY BINDINGS\*U section.
1976 .ne 3
1977 .B history
1979 Usually users work with a shell that allows easy access to previous commands.
1980 For example csh has the command \*Q!!\*U to repeat the last command executed. 
1981 .I Screen
1982 allows you to have a primitive way of re-calling \*Qthe command that
1983 started ...\*U: You just type the first letter of that command, then hit
1984 `C-a {' and
1985 .I screen
1986 tries to find a previous line that matches with the `prompt character' 
1987 to the left of the cursor. This line is pasted into this window's input queue.
1988 Thus you have a crude command history (made up by the visible window and its
1989 scrollback buffer). 
1991 .ne 3
1992 .BI "hstatus " status
1994 Change the window's hardstatus line to the string \fIstatus\fP.
1996 .ne 3
1997 .B idle
1998 .RI [ timeout
1999 .RI [ "cmd args" ]]
2001 Sets a command that is run after the specified number of seconds
2002 inactivity is reached. This command will normally be the \*Qblanker\*U
2003 command to create a screen blanker, but it can be any screen command.
2004 If no command is specified, only the timeout is set. A timeout of
2005 zero (ot the special timeout \fBoff\fP) disables the timer.
2006 If no arguments are given, the current settings are displayed.
2008 .ne 3
2009 .BR "ignorecase " [ on | off ]
2011 Tell screen to ignore the case of characters in searches. Default is
2012 `off'.
2014 .ne 3
2015 .B info
2017 Uses the message line to display some information about the current window:
2018 the cursor position in the form \*Q(column,row)\*U starting with \*Q(1,1)\*U,
2019 the terminal width and height plus the size of the scrollback buffer in lines, 
2020 like in \*Q(80,24)+50\*U, the current state of window XON/XOFF flow control
2021 is shown like this (See also section FLOW CONTROL):
2024   +flow     automatic flow control, currently on.
2025   -flow     automatic flow control, currently off.
2026   +(+)flow  flow control enabled. Agrees with automatic control.
2027   -(+)flow  flow control disabled. Disagrees with automatic control.
2028   +(-)flow  flow control enabled. Disagrees with automatic control.
2029   -(-)flow  flow control disabled. Agrees with automatic control.
2032 The current line wrap setting (`+wrap' indicates enabled, `\-wrap' not) is
2033 also shown. The flags `ins', `org', `app', `log', `mon' or `nored' are 
2034 displayed when the window is in insert mode, origin mode, 
2035 application-keypad mode, has output logging,
2036 activity monitoring or partial redraw enabled.
2038 The currently active character set (\fIG0\fP, \fIG1\fP, \fIG2\fP,
2039 or \fIG3\fP) and in square brackets the terminal character sets that are
2040 currently designated as \fIG0\fP through \fIG3\fP is shown. If the window
2041 is in UTF-8 mode, the string \*QUTF-8\*U is shown instead.
2043 Additional modes depending on the type of the window are displayed at the end of the status line (See also chapter \*QWINDOW TYPES\*U).
2045 If the state machine of the terminal emulator is in a non-default state,
2046 the info line is started with a string identifying the current state.
2048 For system information use the \*Qtime\*U command.
2050 .ne 3
2051 .BR ins_reg " [" \fIkey ]
2053 No longer exists, use \*Qpaste\*U instead.
2055 .ne 3
2056 .B kill
2058 Kill current window.
2059 .br 
2060 If there is an `exec' command running then it is killed. Otherwise the process
2061 (shell) running in the window receives a HANGUP condition, 
2062 the window structure is removed and 
2063 .I screen 
2064 (your display) switches to another
2065 window.  When the last window is destroyed, 
2066 .I screen
2067 exits.
2068 After a kill 
2069 .I screen 
2070 switches to the previously displayed window.
2072 Note:
2073 .I Emacs
2074 users should keep this command in mind, when killing a line.
2075 It is recommended not to use \*QC-a\*U as the
2076 .I screen
2077 escape key or to rebind kill to \*QC-a K\*U.
2079 .ne 3
2080 .B lastmsg
2082 Redisplay the last contents of the message/status line.
2083 Useful if you're typing when a message appears, because  the message goes 
2084 away when you press a key (unless your terminal has a hardware status line).
2085 Refer to the commands \*Qmsgwait\*U and \*Qmsgminwait\*U for fine tuning.
2087 .ne 3
2088 .B license
2090 Display the disclaimer page. This is done whenever
2091 .I screen
2092 is started without options, which should be often enough. See also 
2093 the \*Qstartup_message\*U command.
2095 .ne 3
2096 .B lockscreen
2098 Lock this display.
2099 Call a screenlock program (/local/bin/lck or /usr/bin/lock or a builtin if no
2100 other is available). Screen does not accept any command keys until this program
2101 terminates. Meanwhile processes in the windows may continue, as the windows 
2102 are in the `detached' state. The screenlock program may be changed through the
2103 environment variable $LOCKPRG (which must be set in the shell from which 
2104 .I screen
2105 is started) and is executed with the user's uid and gid.
2107 Warning: 
2108 When you leave other shells unlocked and you have no password set on           
2109 .IR screen ,
2110 the lock is void: One could easily re-attach from an unlocked
2111 shell. This feature should rather be called `lockterminal'.
2113 .ne 3
2114 .BR "log " [ on | off ]
2116 Start/stop writing output of the current window to a file 
2117 \*Qscreenlog.\fIn\fP\*U in the window's default directory, where \fIn\fP 
2118 is the number of the current window. This filename can be changed with
2119 the `logfile' command. If no parameter is given, the state
2120 of logging is toggled. The session log is appended to the previous contents 
2121 of the file if it already exists. The current contents and the contents 
2122 of the scrollback history are not included in the session log.
2123 Default is `off'.
2125 .ne 3
2126 .BI "logfile " filename
2128 .BI "logfile flush " secs
2130 Defines the name the log files will get. The default is
2131 \*Qscreenlog.%n\*U. The second form changes the number of seconds
2132 .I screen
2133 will wait before flushing the logfile buffer to the file-system. The
2134 default value is 10 seconds.
2136 .ne 3
2137 .BR "login " [ on | off ]
2139 Adds or removes the entry in the utmp database file for the current window.
2140 This controls if the window is `logged in'.
2141 When no parameter is given, the login state of the window is toggled.
2142 Additionally to that toggle, it is convenient having a `log in' and a `log out'
2143 key. E.\|g. `bind I login on' and `bind O login off' will map these
2144 keys to be C-a I and C-a O.
2145 The default setting (in config.h.in) should be \*Qon\*U for a 
2146 .I screen
2147 that runs under suid-root.
2148 Use the \*Qdeflogin\*U command to change the default login state for new 
2149 windows. Both commands are only present when 
2150 .I screen
2151 has been compiled with utmp support.
2153 .ne 3
2154 .BR "logtstamp " [ on | off ]
2156 .B "logtstamp after"
2157 .RI [ secs ]
2159 .B "logtstamp string"
2160 .RI [ string ]
2162 This command controls logfile time-stamp mechanism of 
2163 .I screen.
2165 time-stamps are turned \*Qon\*U, 
2166 .I screen 
2167 adds a string containing
2168 the current time to the logfile after two minutes of inactivity.
2169 When output continues and more than another two minutes have passed,
2170 a second time-stamp is added to document the restart of the
2171 output. You can change this timeout with the second form
2172 of the command. The third form is used for customizing the time-stamp
2173 string (`-- %n:%t -- time-stamp -- %M/%d/%y %c:%s --\\n' by
2174 default).
2176 .ne 3
2177 .B mapdefault
2179 Tell 
2180 .I screen 
2181 that the next input character should only be looked up
2182 in the default bindkey table. See also \*Qbindkey\*U.
2184 .ne 3
2185 .B mapnotnext
2187 Like mapdefault, but don't even look in the default bindkey table.
2189 .ne 3
2190 .B maptimeout
2191 .RI [ timo ]
2193 Set the inter-character timer for input sequence detection to a timeout
2195 .I timo
2196 ms. The default timeout is 300ms. Maptimeout with no arguments shows
2197 the current setting.
2198 See also \*Qbindkey\*U.
2200 .ne 3
2201 .BI "markkeys " string
2203 This is a method of changing the keymap used for copy/history mode.
2204 The string is made up of \fIoldchar\fP=\fInewchar\fP pairs which are
2205 separated by `:'. Example: The string \*QB=^B:F=^F\*U will change the 
2206 keys `C-b' and `C-f' to the vi style binding (scroll up/down fill page).
2207 This happens to be the default binding for `B' and `F'.
2208 The command \*Qmarkkeys h=^B:l=^F:$=^E\*U would set the mode for an emacs-style
2209 binding.
2210 If your terminal sends characters, that cause you to abort copy mode,
2211 then this command may help by binding these characters to do nothing.
2212 The no-op character is `@' and is used like this: \*Qmarkkeys
2213 @=L=H\*U if you do not want to use the `H' or `L' commands any longer.
2214 As shown in this example, multiple keys can be assigned to one function in a 
2215 single statement.
2217 .ne 3
2218 .BI "maxwin " num
2220 Set the maximum window number screen will create. Doesn't affect
2221 already existing windows. The number may only be decreased.
2223 .ne 3
2224 .B meta
2226 Insert the command character (C-a) in the current window's input stream.
2228 .ne 3
2229 .BR "monitor " [ on | off ]
2231 Toggles activity monitoring of windows.
2232 When monitoring is turned on and an affected window is switched into the
2233 background, you will receive the activity notification message in the
2234 status line at the first sign of output and the window will also be marked
2235 with an `@' in the window-status display.
2236 Monitoring is initially off for all windows.
2238 .ne 3
2239 .BI "msgminwait " sec
2241 Defines the time 
2242 .I screen 
2243 delays a new message when one message is currently displayed. 
2244 The default is 1 second.
2246 .ne 3
2247 .BI "msgwait " sec
2249 Defines the time a message is displayed if 
2250 .I screen
2251 is not disturbed by other activity. The default is 5 seconds.
2253 .ne 3
2254 .BR "multiuser on" | off
2256 Switch between singleuser and multiuser mode. Standard
2257 .I screen
2258 operation is singleuser. In multiuser mode the commands `acladd',
2259 `aclchg', `aclgrp' and `acldel'
2260 can be used to enable (and disable) other users accessing this 
2261 .I screen
2262 session. 
2264 .ne 3
2265 .BR "nethack on" | off
2267 Changes the kind of error messages used by
2268 .IR screen .
2269 When you are familiar with the game \*Qnethack\*U, you may enjoy the
2270 nethack-style messages which will often blur the facts a little, but are
2271 much funnier to read. Anyway, standard messages often tend to be unclear as
2272 well.
2274 This option is only 
2275 available if
2276 .I screen
2277 was compiled with the NETHACK flag defined. The
2278 default setting is then determined by the presence of the environment 
2279 variable $NETHACKOPTIONS.
2281 .ne 3
2282 .B next
2284 Switch to the next window.
2285 This command can be used repeatedly to cycle through the list of windows.
2287 .ne 3
2288 .B nonblock 
2289 .RB [ on | off | \fInumsecs ]
2291 Tell screen how to deal with user interfaces (displays) that cease to
2292 accept output. This can happen if a user presses ^S or a TCP/modem
2293 connection gets cut but no hangup is received. If nonblock is
2294 \fBoff\fP (this is the default) screen waits until the display
2295 restarts to accept the output. If nonblock is \fBon\fP, screen
2296 waits until the timeout is reached (\fBon\fP is treated as 1s). If the
2297 display still doesn't receive characters, screen will consider
2298 it \*Qblocked\*U and stop sending characters to it. If at
2299 some time it restarts to accept characters, screen will unblock
2300 the display and redisplay the updated window contents.
2302 .ne 3
2303 .BR "number " [ \fIn ]
2305 Change the current windows number. If the given number \fIn\fP is already 
2306 used by another window, both windows exchange their numbers. If no argument is
2307 specified, the current window number (and title) is shown.
2309 .ne 3
2310 .BR "obuflimit " [ \fIlimit ]
2312 If the output buffer contains more bytes than the specified limit, no
2313 more data will be
2314 read from the windows. The default value is 256. If you have a fast
2315 display (like xterm), you can set it to some higher value. If no
2316 argument is specified, the current setting is displayed.
2318 .ne 3
2319 .B only
2321 Kill all regions but the current one.
2323 .ne 3
2324 .B other
2326 Switch to the window displayed previously. If this window does no longer exist,
2327 \fIother\fP has the same effect as \fInext\fP.
2329 .ne 3
2330 .BR "partial on" | off
2332 Defines whether the display should be refreshed (as with \fIredisplay\fP) after
2333 switching to the current window. This command only affects the current window.
2334 To immediately affect all windows use the \fIallpartial\fP command.
2335 Default is `off', of course.  This default is fixed, as there is currently no 
2336 \fIdefpartial\fP command.
2338 .ne 3
2339 .BR "password " [ \fIcrypted_pw ]
2341 Present a crypted password in your \*Q.screenrc\*U file and
2342 .I screen
2343 will ask
2344 for it, whenever someone attempts to resume a detached. This is useful
2345 if you have privileged programs running under
2346 .I screen
2347 and you want to protect your session from reattach attempts by another user
2348 masquerading as your uid (i.e. any superuser.)
2349 If no crypted password is specified,
2350 .I screen
2351 prompts twice for typing a
2352 password and places its encryption in the paste buffer.
2353 Default is `none', this disables password checking.
2355 .ne 3
2356 .BR paste
2357 .RI [ registers " [" dest_reg ]]
2359 Write the (concatenated) contents of the specified registers to the stdin queue
2360 of the current window. The register '.' is treated as the
2361 paste buffer. If no parameter is given the user is prompted for a single 
2362 register to paste.
2363 The paste buffer can be filled with the \fIcopy\fP, \fIhistory\fP and 
2364 \fIreadbuf\fP commands. 
2365 Other registers can be filled with the \fIregister\fP, \fIreadreg\fP and 
2366 \fIpaste\fP commands.
2367 If \fIpaste\fP is called with a second argument, the contents of the specified
2368 registers is pasted into the named destination register rather than 
2369 the window. If '.' is used as the second argument, the displays paste buffer is
2370 the destination.
2371 Note, that \*Qpaste\*U uses a wide variety of resources: Whenever a second 
2372 argument is specified no current window is needed. When the source specification
2373 only contains registers (not the paste buffer) then there need not be a current 
2374 display (terminal attached), as the registers are a global resource. The 
2375 paste buffer exists once for every user.
2377 .ne 3
2378 .BR "pastefont " [ on | off ]
2380 Tell 
2381 .I screen 
2382 to include font information in the paste buffer. The
2383 default is not to do so. This command is especially useful for
2384 multi character fonts like kanji.
2386 .ne 3
2387 .B pow_break
2389 Reopen the window's terminal line and send a break condition. See `break'.
2391 .ne 3
2392 .B pow_detach
2394 Power detach. 
2395 Mainly the same as \fIdetach\fP, but also sends a HANGUP signal to
2396 the parent process of
2397 .IR screen .
2398 CAUTION: This will result in a logout, when 
2399 .I screen
2400 was started from your login shell.
2402 .ne 3
2403 .B pow_detach_msg
2404 .RI [ message ]
2406 The \fImessage\fP specified here is output whenever a `Power detach' was
2407 performed. It may be used as a replacement for a logout message or to reset 
2408 baud rate, etc. 
2409 Without parameter, the current message is shown.
2411 .ne 3
2412 .B prev
2414 Switch to the window with the next lower number.
2415 This command can be used repeatedly to cycle through the list of windows.
2417 .ne 3
2418 .B printcmd
2419 .RI [ cmd ]
2422 .I cmd
2423 is not an empty string, 
2424 .I screen 
2425 will not use the terminal capabilities
2426 \*Qpo/pf\*U if it detects an ansi print sequence
2427 .BR "ESC [ 5 i" ,
2428 but pipe the output into
2429 .IR cmd .
2430 This should normally be a command like \*Qlpr\*U or
2431 \*Q'cat > /tmp/scrprint'\*U.
2432 .B printcmd
2433 without a command displays the current setting.
2434 The ansi sequence
2435 .B "ESC \e"
2436 ends printing and closes the pipe.
2438 Warning: Be careful with this command! If other user have write
2439 access to your terminal, they will be able to fire off print commands.
2441 .ne 3
2442 .BR process " [" \fIkey ]
2444 Stuff the contents of the specified register into 
2445 .IR screen 's
2446 input queue. If no argument is given you are prompted for a
2447 register name. The text is parsed as if it had been typed in from the user's
2448 keyboard. This command can be used to bind multiple actions to a single key.
2450 .ne 3
2451 .B quit
2453 Kill all windows and terminate
2454 .IR screen .
2455 Note that on VT100-style terminals the keys C-4 and C-\e are identical.
2456 This makes the default bindings dangerous:
2457 Be careful not to type C-a C-4 when selecting window no. 4.
2458 Use the empty bind command (as in \*Qbind '^\e'\*U) to remove a key binding.
2460 .ne 3
2461 .B readbuf
2462 .RB [ -e
2463 .IR encoding ]
2464 .RI [ filename ]
2466 Reads the contents of the specified file into the paste buffer.
2467 You can tell screen the encoding of the file via the \fB-e\fP option.
2468 If no file is specified, the screen-exchange filename is used.
2469 See also \*Qbufferfile\*U command.
2471 .ne 3
2472 .B readreg 
2473 .RB [ -e
2474 .IR encoding ]
2475 .RI [ register " [" filename ]]
2477 Does one of two things, dependent on number of arguments: with zero or one
2478 arguments it it duplicates the paste buffer contents into the register specified
2479 or entered at the prompt. With two arguments it reads the contents of the named 
2480 file into the register, just as \fIreadbuf\fP reads the screen-exchange file
2481 into the paste buffer.
2482 You can tell screen the encoding of the file via the \fB-e\fP option.
2483 The following example will paste the system's password file into 
2484 the 
2485 .I screen 
2486 window (using register p, where a copy remains):
2489         C-a : readreg p /etc/passwd
2490         C-a : paste p
2493 .ne 3
2494 .B redisplay
2496 Redisplay the current window. Needed to get a full redisplay when in
2497 partial redraw mode.
2499 .ne 3
2500 .B register
2501 .RB [ -e
2502 .IR encoding ]
2503 .I "key string"
2505 Save the specified \fIstring\fP to the register \fIkey\fP.
2506 The encoding of the string can be specified via the \fB-e\fP option.
2507 See also the \*Qpaste\*U command.
2509 .ne 3
2510 .B "remove"
2512 Kill the current region. This is a no-op if there is only one region.
2514 .ne 3
2515 .B "removebuf"
2517 Unlinks the screen-exchange file used by the commands \*Qwritebuf\*U and 
2518 \*Qreadbuf\*U. 
2520 .ne 3
2521 .B "rendition bell" | monitor | so
2522 .RB "\fIattr\fR " [ \fIcolor ]
2524 Change the way
2525 .I screen
2526 renders the titles of windows that have monitor or bell flags set in caption or hardstatus or windowlist. See the \*QSTRING ESCAPES\*U chapter for the syntax of the modifiers.
2527 The default for monitor is currently \*Q=u dd\*U (underline, default colors) and for bell \*Q=B dd\*U (blink, default colors).
2529 .ne 3
2530 .B "reset"
2531 .PP 
2532 Reset the virtual terminal to its \*Qpower-on\*U values. Useful when strange
2533 settings (like scroll regions or graphics character set) are left over from
2534 an application.
2536 .ne 3
2537 .B "resize"
2538 .PP 
2539 Resize the current region. The space will be removed from or added to
2540 the region below or if there's not enough space from the region above.
2542 resize +N       increase current region height by N
2544 resize -N       decrease current region height by N
2546 resize  N       set current region height to N
2548 resize  =       make all windows equally high
2550 resize  max     maximize current region height
2552 resize  min     minimize current region height
2555 .ne 3
2556 .B "screen \fP[\fI-opts\fP] [\fIn\fP] [\fIcmd\fP [\fIargs\fP]]"
2558 Establish a new window.
2559 The flow-control options (\fB\-f\fP, \fB\-fn\fP and \fB\-fa\fP),
2560 title (a.\|k.\|a.) option (\fB\-t\fP), login options (\fB-l\fP and \fB-ln\fP)
2561 , terminal type option (\fB-T\fP <term>), the all-capability-flag (\fB-a\fP)
2562 and scrollback option (\fB-h\fP <num>) may be specified with each command. 
2563 The option (\fB-M\fP) turns monitoring on for this window.
2564 The option (\fB-L\fP) turns output logging on for this window.
2565 If an optional number \fIn\fP in the range 0..9 is given, the window
2566 number \fIn\fP is assigned to the newly created window (or, if this
2567 number is already in-use, the next available number).
2568 If a command is specified after \*Qscreen\*U, this command (with the given
2569 arguments) is started in the window; otherwise, a shell is created.
2570 Thus, if your \*Q.screenrc\*U contains the lines
2573         # example for .screenrc:
2574         screen 1
2575         screen -fn -t foobar -L 2 telnet foobar
2578 .I screen
2579 creates a shell window (in window #1) and a window with a TELNET connection
2580 to the machine foobar (with no flow-control using the title \*Qfoobar\*U
2581 in window #2) and will write a logfile (\*Qscreenlog.2\*U) of the telnet 
2582 session.
2583 Note, that unlike previous versions of
2584 .I screen
2585 no additional default window is created when \*Qscreen\*U commands are 
2586 included in your \*Q.screenrc\*U file. When the initialization is completed,
2587 .I screen
2588 switches to the last window specified in your .screenrc file or, if none,
2589 opens a default window #0.
2591 Screen has built in some functionality of \*Qcu\*U and \*Qtelnet\*U.
2592 See also chapter \*QWINDOW TYPES\*U.
2594 .ne 3
2595 .B "scrollback \fP\fInum\fP"
2597 Set the size of the scrollback buffer for the current windows to \fInum\fP 
2598 lines. The default scrollback is 100 lines.
2599 See also the \*Qdefscrollback\*U command and use \*QC-a i\*U to view the 
2600 current setting.
2602 .ne 3
2603 .BR "select " [ \fIWindowID ]
2605 Switch to the window identified by \fIWindowID\fP.
2606 This can be a prefix of a window title (alphanumeric window name) or a
2607 window number.
2608 The parameter is optional and if omitted, you get prompted for an identifier. 
2609 When a new window is established, the first available number
2610 is assigned to this window.
2611 Thus, the first window can be activated by \*Qselect 0\*U.
2612 The number of windows is limited at compile-time by the MAXWIN
2613 configuration parameter.
2614 There are two special WindowIDs, \*Q-\*U selects the
2615 internal blank window and \*Q.\*U selects the current window. The
2616 latter is useful if used with screen's \*Q-X\*U option.
2619 .BR "sessionname " [ \fIname ]
2621 Rename the current session. Note, that for \*Qscreen -list\*U the
2622 name shows up with the process-id prepended. If the argument \*Qname\*U
2623 is omitted, the name of this session is displayed. Caution: The $STY 
2624 environment variables still reflects the old name. This may result in 
2625 confusion. 
2626 The default is constructed from the tty and host names.
2628 .ne 3
2629 .B "setenv " 
2630 .RI [ var " [" string ]]
2632 Set the environment variable \fIvar\fP to value \fIstring\fP.
2633 If only \fIvar\fP is specified, the user will be prompted to enter a value.
2634 If no parameters are specified, the user will be prompted for both variable
2635 and value. The environment is inherited by all subsequently forked shells.
2637 .ne 3
2638 .BR "setsid " [ on | off ]
2640 Normally screen uses different sessions and process groups for
2641 the windows. If setsid is turned \fIoff\fP, this is not done
2642 anymore and all windows will be in the same process group as the
2643 screen backend process. This also breaks job-control, so be careful.
2644 The default is \fIon\fP, of course. This command is probably useful
2645 only in rare circumstances.
2647 .ne 3
2648 .B "shell \fIcommand\fP"
2650 Set the command to be used to create a new shell.
2651 This overrides the value of the environment variable $SHELL.
2652 This is useful if you'd like to run a tty-enhancer which is expecting to
2653 execute the program specified in $SHELL. If the command begins with
2654 a '-' character, the shell will be started as a login-shell.
2656 .ne 3
2657 .B "shelltitle \fItitle\fP"
2659 Set the title for all shells created during startup or by
2660 the C-A C-c command.
2661 For details about what a title is, see the discussion
2662 entitled \*QTITLES (naming windows)\*U.
2664 .ne 3
2665 .BR "silence " [ on | off "|\fIsec\fP]"
2667 Toggles silence monitoring of windows.
2668 When silence is turned on and an affected window is switched into the
2669 background, you will receive the silence notification message in the
2670 status line after a specified period of inactivity (silence). The default
2671 timeout can be changed with the `silencewait' command or by specifying a 
2672 number of seconds instead of `on' or `off'.
2673 Silence is initially off for all windows.
2675 .ne 3
2676 .BI "silencewait " sec
2678 Define the time that all windows monitored for silence should wait before
2679 displaying a message. Default 30 seconds.
2682 .B "sleep \fP\fInum\fP"
2684 This command will pause the execution of a .screenrc file for \fInum\fP seconds.
2685 Keyboard activity will end the sleep.
2686 It may be used to give users a chance to read the messages output by \*Qecho\*U.
2688 .ne 3
2689 .B "slowpaste \fImsec\fP"
2691 Define the speed at which text is inserted into the current window by the 
2692 paste ("C-a ]") command. 
2693 If the slowpaste value is nonzero text is written character by character.
2694 .I screen
2695 will make a pause of \fImsec\fP milliseconds after each single character write 
2696 to allow the application to process its input. Only use slowpaste if your 
2697 underlying system exposes flow control problems while pasting large amounts of 
2698 text. 
2700 .ne 3
2701 .BI "source " file
2703 Read and execute commands from file \fIfile\fP. Source commands may
2704 be nested to a maximum recursion level of ten. If file is not an
2705 absolute path and screen is already processing a source command, the
2706 parent directory of the running source command file is used to search
2707 for the new command file before screen's current directory.
2709 Note that termcap/terminfo/termcapinfo commands only work at
2710 startup and reattach time, so they must be reached via the
2711 default screenrc files to have an effect.
2713 .ne 3
2714 .B sorendition
2715 .RB [ "\fIattr\fR " [ \fIcolor ]]
2717 Change the way 
2718 .I screen 
2719 does highlighting for text marking and printing messages.
2720 See the \*QSTRING ESCAPES\*U chapter for the syntax of the modifiers.
2721 The default is currently \*Q=s dd\*U (standout, default colors).
2723 .ne 3
2724 .B split
2726 Split the current region into two new ones. All regions on the
2727 display are resized to make room for the new region. The blank
2728 window is displayed on the new region. Use the \*Qremove\*U or the
2729 \*Qonly\*U command to delete regions.
2730 Use \*Qfocus\*U to toggle between regions.
2732 .ne 3
2733 .B "startup_message on\fP|\fBoff"
2735 Select whether you want to see the copyright notice during startup.
2736 Default is `on', as you probably noticed.
2738 .ne 3
2739 .B stuff
2740 .I string
2742 Stuff the string
2743 .I string
2744 in the input buffer of the current window.
2745 This is like the \*Qpaste\*U command but with much less overhead.
2746 You cannot paste
2747 large buffers with the \*Qstuff\*U command. It is most useful for key
2748 bindings. See also \*Qbindkey\*U.
2750 .ne 3
2751 .B su
2752 .RB [ username " [" password
2753 .RB [ password2 ]]
2755 Substitute the user of a display. The command prompts for all parameters that
2756 are omitted. If passwords are specified as parameters, they have to be
2757 specified un-crypted. The first password is matched against the systems
2758 passwd database, the second password is matched against the 
2759 .I screen
2760 password as set with the commands \*Qacladd\*U or \*Qpassword\*U.
2761 \*QSu\*U may be useful for the 
2762 .I screen
2763 administrator to test multiuser setups.
2764 .\"                                             XXX removed in 3.8.0 XXX
2765 .\" but it is mainly used implicitly
2766 .\" by the \*Qconnect\*U command to identify users that access a remote session.
2767 When the identification fails, the user has access to the commands available
2768 for user
2769 .BR nobody .
2770 These are \*Qdetach\*U, \*Qlicense\*U, \*Qversion\*U, \*Qhelp\*U and
2771 \*Qdisplays\*U.
2773 .ne 3
2774 .B "suspend"
2776 Suspend
2777 .IR screen .
2778 The windows are in the `detached' state, while 
2779 .I screen
2780 is suspended. This feature relies on the shell being able to do job control.
2782 .ne 3
2783 .B "term \fIterm\fP"
2785 In each window's environment
2786 .I screen
2787 opens, the $TERM variable is set to \*Qscreen\*U by default. 
2788 But when no description for \*Qscreen\*U is installed in the local termcap
2789 or terminfo data base, you set $TERM to \- say \-
2790 \*Qvt100\*U. This won't do much harm, as 
2791 .I screen
2792 is VT100/ANSI compatible.
2793 The use of the \*Qterm\*U command is discouraged for non-default purpose.
2794 That is, one may want to specify special $TERM settings (e.g. vt100) for the
2795 next \*Qscreen rlogin othermachine\*U command. Use the command \*Qscreen -T vt100
2796 rlogin othermachine\*U rather than setting and resetting the default.
2798 .ne 3
2799 .BI termcap " term terminal-tweaks"
2800 .RI [ window-tweaks ]
2802 .BI terminfo " term terminal-tweaks"
2803 .RI [ window-tweaks ]
2805 .BI termcapinfo " term terminal-tweaks"
2806 .RI [ window-tweaks ]
2808 Use this command to modify your terminal's termcap entry without going
2809 through all the hassles involved in creating a custom termcap entry.
2810 Plus, you can optionally customize the termcap generated for the windows.
2811 You have to place these commands in one of the screenrc startup files, as
2812 they are meaningless once the terminal emulator is booted.  
2814 If your system works uses the terminfo database rather than termcap, 
2815 .I screen 
2816 will understand the `terminfo' command, which has the same effects as the
2817 `termcap' command.  Two separate commands are provided, as there are subtle
2818 syntactic differences, e.g. when parameter interpolation (using `%') is
2819 required. Note that termcap names of the capabilities have to be used
2820 with the `terminfo' command. 
2822 In many cases, where the arguments are valid in both terminfo and termcap
2823 syntax, you can use the command `termcapinfo', which is just a shorthand
2824 for a pair of `termcap' and `terminfo' commands with identical arguments.
2826 The first argument specifies which terminal(s) should be affected by this
2827 definition.
2828 You can specify multiple terminal names by separating them with `|'s.
2829 Use `*' to match all terminals and `vt*' to match all terminals that begin
2830 with \*Qvt\*U.
2832 Each \fItweak\fP argument contains one or more termcap defines (separated
2833 by `:'s) to be inserted at the start of the appropriate termcap entry,
2834 enhancing it or overriding existing values.
2835 The first tweak modifies your terminal's termcap, and contains definitions
2836 that your terminal uses to perform certain functions.
2837 Specify a null string to leave this unchanged (e.\|g. '').
2838 The second (optional) tweak modifies all the window termcaps, and should
2839 contain definitions that
2840 .I screen
2841 understands (see the \*QVIRTUAL TERMINAL\*U
2842 section).
2844 Some examples:
2846 termcap xterm*  LP:hs@
2848 Informs
2849 .I screen
2850 that all terminals that begin with `xterm' have firm auto-margins that
2851 allow the last position on the screen to be updated (LP), but they don't
2852 really have a status line (no 'hs' \- append `@' to turn entries off).
2853 Note that we assume `LP' for all terminal names that start with \*Qvt\*U,
2854 but only if you don't specify a termcap command for that terminal.
2856 termcap vt*  LP
2858 termcap vt102|vt220  Z0=\eE[?3h:Z1=\eE[?3l
2860 Specifies the firm-margined `LP' capability for all terminals that begin with
2861 `vt', and the second line will also add the escape-sequences to switch
2862 into (Z0) and back out of (Z1) 132-character-per-line mode if this is
2863 a VT102 or VT220.
2864 (You must specify Z0 and Z1 in your termcap to use the width-changing
2865 commands.)
2867 termcap vt100  ""  l0=PF1:l1=PF2:l2=PF3:l3=PF4
2869 This leaves your vt100 termcap alone and adds the function key labels to
2870 each window's termcap entry.
2872 termcap h19|z19  am@:im=\eE@:ei=\eEO  dc=\eE[P
2874 Takes a h19 or z19 termcap and turns off auto-margins (am@) and enables the
2875 insert mode (im) and end-insert (ei) capabilities (the `@' in the `im'
2876 string is after the `=', so it is part of the string).
2877 Having the `im' and `ei' definitions put into your terminal's termcap will
2878 cause
2879 .I screen
2880 to automatically advertise the character-insert capability in
2881 each window's termcap.
2882 Each window will also get the delete-character capability (dc) added to its
2883 termcap, which
2884 .I screen
2885 will translate into a line-update for the terminal
2886 (we're pretending it doesn't support character deletion).
2888 If you would like to fully specify each window's termcap entry, you should
2889 instead set the $SCREENCAP variable prior to running
2890 .IR screen .
2891 See the discussion on the \*QVIRTUAL TERMINAL\*U in this manual, and the termcap(5)
2892 man page for more information on termcap definitions.
2894 .ne 3
2895 .B time
2896 .RI [ string ]
2898 Uses the message line to display the time of day, the host name, and the load
2899 averages over 1, 5, and 15 minutes (if this is available on your system).
2900 For window specific information use \*Qinfo\*U.
2902 If a string is specified, it changes the format of the time report like it is
2903 described in the \*QSTRING ESCAPES\*U chapter. Screen uses a default of
2904 "%c:%s %M %d %H%? %l%?".
2906 .ne 3
2907 .BR "title " [ \fIwindowtitle ]
2909 Set the name of the current window to \fIwindowtitle\fP. If no name is 
2910 specified,
2911 .I screen
2912 prompts for one. This command was known as `aka' in previous
2913 releases.
2915 .ne 3
2916 .BI "unsetenv " var
2918 Unset an environment variable.
2920 .ne 3
2921 .B utf8
2922 .RB [ on | off
2923 .RB [ on | off ]]
2925 Change the encoding used in the current window. If utf8 is enabled, the
2926 strings sent to the window will be UTF-8 encoded and vice versa. Omitting the
2927 parameter toggles the setting. If a second parameter is given, the display's
2928 encoding is also changed (this should rather be done with screen's \*Q-U\*U
2929 option).
2930 See also \*Qdefutf8\*U, which changes the default setting of a new
2931 window.
2933 .ne 3
2934 .B vbell 
2935 .RB [ on | off ]
2937 Sets the visual bell setting for this window. Omitting the parameter
2938 toggles the setting. If vbell is switched on, but your terminal does not 
2939 support a visual bell, a `vbell-message' is displayed in the status line when
2940 the bell character (^G) is received.
2941 Visual bell support of a terminal is defined by the termcap variable `vb' 
2942 (terminfo: 'flash'). 
2944 Per default, vbell is off, thus the audible bell is used. 
2945 See also `bell_msg'.
2947 .ne 3
2948 .B vbell_msg
2949 .RI [ message ]
2951 Sets the visual bell message. \fImessage\fP is printed to the status line if
2952 the window receives a bell character (^G), vbell is set to \*Qon\*U, but the 
2953 terminal does not support a visual bell.
2954 The default message is \*QWuff, Wuff!!\*U.
2955 Without parameter, the current message is shown.
2957 .ne 3
2958 .BI "vbellwait " sec
2960 Define a delay in seconds after each display of 
2961 .IR screen 's
2962 visual bell message. The default is 1 second.
2964 .ne 3
2965 .B verbose
2966 .RB [ on | off ]
2968 If verbose is switched on, the command name is echoed, whenever a window
2969 is created (or resurrected from zombie state). Default is off.
2970 Without parameter, the current setting is shown.
2972 .ne 3
2973 .B version
2975 Print the current version and the compile date in the status line.
2977 .ne 3
2978 .BI "wall " "message"
2980 Write a message to all displays. The message will appear in the terminal's
2981 status line.
2983 .ne 3
2984 .B width
2985 .RB [ -w | -d ]
2986 .RI [ cols " [" lines ]]
2988 Toggle the window width between 80 and 132 columns or set it to \fIcols\fP 
2989 columns if an argument is specified. 
2990 This requires a capable terminal and the termcap entries \*QZ0\*U and \*QZ1\*U.
2991 See the \*Qtermcap\*U command for more information. You can also specify
2992 a new height if you want to change both values.
2994 .B -w
2995 option tells screen to leave the display size unchanged and just set
2996 the window size,
2997 .B -d
2998 vice versa.
3000 .ne 3
3001 .B windowlist
3002 .RB [ -b ]
3003 .RB [ -m ]
3005 .B windowlist
3006 .B string
3007 .RI [ string ]
3009 .B windowlist
3010 .B title
3011 .RI [ title ]
3013 Display all windows in a table for visual window selection. The
3014 desired window can be selected via the standard movement keys (see
3015 the \*Qcopy\*U command) and activated via the return key.
3016 If the 
3017 .B -b
3018 option is given, screen will switch to the blank window before
3019 presenting the list, so that the current window is also selectable.
3021 .B -m
3022 option changes the order of the windows, instead of sorting by
3023 window numbers screen uses its internal most-recently-used list.
3025 The table format can be changed with the \fBstring\fP and
3026 \fBtitle\fP option, the title is displayed as table heading, while
3027 the lines are made by using the string setting. The default
3028 setting is \*QNum Name%=Flags\*U for the title and \*Q%3n %t%=%f\*U
3029 for the lines.
3030 See the \*QSTRING ESCAPES\*U chapter for more codes (e.g. color
3031 settings).
3033 .ne 3
3034 .B windows
3036 Uses the message line to display a list of all the windows.
3037 Each window is listed by number with the name of process that has been
3038 started in the window (or its title);
3039 the current window is marked with a `*';
3040 the previous window is marked with a `-';
3041 all the windows that are \*Qlogged in\*U are marked with a `$';
3042 a background window that has received a bell is marked with a `!';
3043 a background window that is being monitored and has had activity occur
3044 is marked with an `@';
3045 a window which has output logging turned on is marked with `(L)'; 
3046 windows occupied by other users are marked with `&';
3047 windows in the zombie state are marked with `Z'.
3048 If this list is too long to fit on the terminal's status line only the
3049 portion around the current window is displayed.
3051 .ne 3
3052 .BR "wrap " [ on | off ]
3054 Sets the line-wrap setting for the current window.
3055 When line-wrap is on, the second consecutive printable character output at
3056 the last column of a line will wrap to the start of the following line.
3057 As an added feature, backspace (^H) will also wrap through the left margin
3058 to the previous line.
3059 Default is `on'.
3061 .ne 3
3062 .B writebuf
3063 .RB [ -e
3064 .IR encoding ]
3065 .RI [ filename ]
3067 Writes the contents of the paste buffer to the specified file, or the public accessible screen-exchange
3068 file if no filename is given. This is thought of as a primitive means of communication between
3069 .I screen
3070 users on the same host. If an encoding is specified the paste buffer
3071 is recoded on the fly to match the encoding.
3072 The filename can be set with the \fIbufferfile\fP
3073 command and defaults to \*Q/tmp/screen-exchange\*U.
3075 .ne 3
3076 .BR "writelock " [ on | "off\fR|\fBauto\fR]"
3078 In addition to access control lists, not all users may be able to write to
3079 the same window at once. Per default, writelock is in `auto' mode and
3080 grants exclusive input permission to the user who is the first to switch
3081 to the particular window. When he leaves the window, other users may obtain
3082 the writelock (automatically). The writelock of the current window is disabled
3083 by the command \*Qwritelock off\*U. If the user issues the command 
3084 \*Qwritelock on\*U he keeps the exclusive write permission while switching
3085 to other windows.
3087 .ne 3
3088 .B xoff
3090 .B xon
3092 Insert a CTRL-s / CTRL-q character to the stdin queue of the
3093 current window.
3095 .ne 3
3096 .B zmodem
3097 .RB [ off\fR|\fPauto\fR|\fPcatch\fR|\fPpass ]
3099 .B "zmodem sendcmd"
3100 .RI [ string ]
3102 .B "zmodem recvcmd"
3103 .RI [ string ]
3105 Define zmodem support for screen. Screen understands two different
3106 modes when it detects a zmodem request: \*Qpass\*U and \*Qcatch\*U.
3107 If the mode is set to \*Qpass\*U, screen will relay all data
3108 to the attacher until the end of the transmission is reached.
3109 In \*Qcatch\*U mode screen acts as a zmodem endpoint and starts
3110 the corresponding rz/sz commands. If the mode is set to \*Qauto\*U,
3111 screen will use \*Qcatch\*U if the window is a tty (e.g. a serial line),
3112 otherwise it will use \*Qpass\*U.
3114 You can define the templates screen uses in \*Qcatch\*U mode
3115 via the second and the third form.
3117 Note also that this is an experimental feature.
3119 .ne 3
3120 .BR "zombie " [\fIkeys\fP [ onerror ] ]
3122 .BR "defzombie " [\fIkeys\fP]
3124 Per default
3125 .I screen 
3126 windows are removed from the window list as soon as
3127 the windows process (e.g. shell) exits. When a string of two keys is 
3128 specified to the zombie command, `dead' windows will remain in the list.
3129 The \fBkill\fP command may be used to remove such a window. Pressing the 
3130 first key in the dead window has the same effect. When pressing the second 
3131 key, 
3132 .I screen 
3133 will attempt to resurrect the window. The process that was 
3134 initially running in the window will be launched again. Calling \fBzombie\fP
3135 without parameters will clear the zombie setting, thus making windows disappear 
3136 when their process exits.
3138 As the zombie-setting is manipulated globally for all windows, this command 
3139 should only be called \fBdefzombie\fP. Until we need this as a per window 
3140 setting, the commands \fBzombie\fP and \fBdefzombie\fP are synonymous.
3142 Optionally you can put the word \*Qonerror\*U after the keys. This will cause screen
3143 to monitor exit status of the process running in the window. If it exits normally ('0'), 
3144 the window disappears. Any other exit value causes the window to become a zombie.
3146 .SH "THE MESSAGE LINE"
3147 .I Screen
3148 displays informational messages and other diagnostics in a \fImessage line\fP.
3149 While this line is distributed to appear at the bottom of the screen,
3150 it can be defined to appear at the top of the screen during compilation.
3151 If your terminal has a status line defined in its termcap,
3152 .I screen
3153 will use this for displaying its messages, otherwise a line of the
3154 current screen will
3155 be temporarily overwritten and output will be momentarily interrupted. The
3156 message line is automatically removed after a few seconds delay, but it
3157 can also be removed early (on terminals without a status line) by beginning
3158 to type.
3160 The message line facility can be used by an application running in
3161 the current window by means of the ANSI \fIPrivacy message\fP
3162 control sequence.
3163 For instance, from within the shell, try something like:
3165 echo '<esc>^Hello world from window '$WINDOW'<esc>\e\e'
3167 where '<esc>' is an \fIescape\fP, '^' is a literal up-arrow,
3168 and '\e\e' turns into a single backslash.
3170 .SH "WINDOW TYPES"
3171 Screen provides three different window types. New windows are created with 
3172 .IR screen 's
3173 .B screen
3174 command (see also the entry in chapter \*QCUSTOMIZATION\*U). The first
3175 parameter to the 
3176 .B screen
3177 command defines which type of window is created. The different window types are
3178 all special cases of the normal type. They have been added in order
3179 to allow 
3180 .I screen 
3181 to be used efficiently as a console multiplexer with 100 or more windows.
3183 .IP \(bu 3
3184 The normal window contains a shell (default, if no parameter is given) or any
3185 other system command that could be executed from a shell (e.g.  
3186 .BR slogin ,
3187 etc...) 
3189 .IP \(bu
3190 If a tty (character special device) name (e.g. \*Q/dev/ttya\*U)
3191 is specified as the first parameter, then the window is directly connected to
3192 this device. 
3193 This window type is similar to \*Qscreen cu -l /dev/ttya\*U.
3194 Read and write access is required on the device node, an exclusive open is
3195 attempted on the node to mark the connection line as busy.
3196 An optional parameter is allowed consisting of a comma separated list of flags
3197 in the notation used by stty(1):
3199 .IP <baud_rate>         
3200 Usually 300, 1200, 9600 or 19200. This affects transmission as well as receive speed.
3201 .IP "cs8 or cs7"
3202 Specify the transmission of eight (or seven) bits per byte.
3203 .IP "ixon or -ixon"
3204 Enables (or disables) software flow-control (CTRL-S/CTRL-Q) for sending data.
3205 .IP "ixoff or -ixon"
3206 Enables (or disables) software flow-control for receiving data.
3207 .IP "istrip or -istrip"
3208 Clear (or keep) the eight bit in each received byte.
3210 You may want to specify as many of these options as applicable. Unspecified
3211 options cause the terminal driver to make up the parameter values of the
3212 connection.  These values are system dependent and may be in defaults or values
3213 saved from a previous connection.
3215 For tty windows, the 
3216 .B info
3217 command shows some of the modem control lines
3218 in the status line. These may include `RTS', `CTS', 'DTR', `DSR', `CD' and more.
3219 This depends on the available ioctl()'s and system header files as well as the
3220 on the physical capabilities of the serial board. 
3221 Signals that are logical low (inactive) have their name preceded by
3222 an exclamation mark (!), otherwise the signal is logical high (active).
3223 Signals not supported by the hardware but available to the ioctl() interface
3224 are usually shown low. 
3226 When the CLOCAL status bit is true, the whole set of modem signals is placed 
3227 inside curly braces ({ and }).
3228 When the CRTSCTS or TIOCSOFTCAR bit is set, the signals `CTS' or `CD' 
3229 are shown in parenthesis, respectively. 
3232 For tty windows, the command
3233 .B break
3234 causes the Data transmission line (TxD) to go low for a specified period of
3235 time. This is expected to be interpreted as break signal on the other side.
3236 No data is sent and no modem control line is changed when a 
3237 .B break
3238 is issued.
3240 .IP \(bu
3241 If the first parameter is \*Q//telnet\*U, the second parameter is expected to
3242 be a host name, and an optional third parameter may specify a TCP port number
3243 (default decimal 23).  Screen will connect to a server listening on the remote
3244 host and use the telnet protocol to communicate with that server.
3247 For telnet windows, the command
3248 .B info
3249 shows details about the connection in square brackets ([ and ]) at the end of
3250 the status line. 
3252 .IP b
3253 BINARY. The connection is in binary mode.
3254 .IP e
3255 ECHO. Local echo is disabled.
3256 .IP c
3257 SGA. The connection is in `character mode' (default: `line mode').
3258 .IP t
3259 TTYPE. The terminal type has been requested by the remote host.
3260 Screen sends the name \*Qscreen\*U unless instructed otherwise (see also
3261 the command `term').
3262 .IP w
3263 NAWS. The remote site is notified about window size changes.
3264 .IP f
3265 LFLOW. The remote host will send flow control information.
3266 (Ignored at the moment.)
3268 Additional flags for debugging are x, t and n (XDISPLOC, TSPEED and
3269 NEWENV).
3271 For telnet windows, the command
3272 .B break
3273 sends the telnet code IAC BREAK (decimal 243) to the remote host.
3276 This window type is only available if
3277 .I screen
3278 was compiled with the BUILTIN_TELNET option defined.
3282 .SH "STRING ESCAPES"
3283 Screen provides an escape mechanism to insert information like the
3284 current time into messages or file names. The escape character
3285 is '%' with one exception: inside of a window's hardstatus '^%' ('^E')
3286 is used instead.
3288 Here is the full list of supported escapes:
3289 .IP %
3290 the escape character itself
3291 .IP a
3292 either 'am' or 'pm'
3293 .IP A
3294 either 'AM' or 'PM'
3295 .IP c
3296 current time HH:MM in 24h format
3297 .IP C
3298 current time HH:MM in 12h format
3299 .IP d
3300 day number
3301 .IP D
3302 weekday name
3303 .IP f
3304 flags of the window
3305 .IP F
3306 sets %? to true if the window has the focus
3307 .IP h
3308 hardstatus of the window
3309 .IP H
3310 hostname of the system
3311 .IP l
3312 current load of the system
3313 .IP m
3314 month number
3315 .IP M
3316 month name
3317 .IP n
3318 window number
3319 .IP S
3320 session name
3321 .IP s
3322 seconds
3323 .IP t
3324 window title
3325 .IP u
3326 all other users on this window
3327 .IP w
3328 all window numbers and names. With '-' qualifier: up to the current
3329 window; with '+' qualifier: starting with the window after the current
3330 one.
3331 .IP W
3332 all window numbers and names except the current one
3333 .IP y
3334 last two digits of the year number
3335 .IP Y
3336 full year number
3337 .IP ?
3338 the part to the next '%?' is displayed only if a '%' escape
3339 inside the part expands to a non-empty string
3340 .IP :
3341 else part of '%?'
3342 .IP =
3343 pad the string to the display's width (like TeX's hfill). If a
3344 number is specified, pad to the percentage of the window's width.
3345 A '0' qualifier tells screen to treat the number as absolute position.
3346 You can specify to pad relative to the last absolute pad position
3347 by adding a '+' qualifier or to pad relative to the right margin
3348 by using '-'. The padding truncates the string if the specified
3349 position lies before the current position. Add the 'L' qualifier
3350 to change this.
3351 .IP <
3352 same as '%=' but just do truncation, do not fill with spaces
3353 .IP >
3354 mark the current text position for the next truncation. When
3355 screen needs to do truncation, it tries to do it in a way that
3356 the marked position gets moved to the specified percentage of
3357 the output area. (The area starts from the last absolute pad
3358 position and ends with the position specified by the truncation
3359 operator.) The 'L' qualifier tells screen to mark the truncated
3360 parts with '...'.
3361 .IP {
3362 attribute/color modifier string terminated by the next \*Q}\*U
3363 .IP `
3364 Substitute with the output of a 'backtick' command. The length
3365 qualifier is misused to identify one of the commands.
3367 The 'c' and 'C' escape may be qualified with a '0' to make 
3368 .I screen 
3369 use zero instead of space as fill character. The '0' qualifier
3370 also makes the '=' escape use absolute positions. The 'n' and '='
3371 escapes understand
3372 a length qualifier (e.g. '%3n'), 'D' and 'M' can be prefixed with 'L'
3373 to generate long names, 'w' and 'W' also show the window flags
3374 if 'L' is given.
3376 An attribute/color modifier is is used to change the attributes or the
3377 color settings. Its format
3378 is \*Q[attribute modifier] [color description]\*U. The attribute modifier
3379 must be prefixed by a change type indicator if it can be confused with
3380 a color description. The following change types are known:
3381 .IP +
3382 add the specified set to the current attributes
3383 .IP -
3384 remove the set from the current attributes
3385 .IP !
3386 invert the set in the current attributes
3387 .IP =
3388 change the current attributes to the specified set
3390 The attribute set can either be specified as a hexadecimal number or
3391 a combination of the following letters:
3392 .IP d
3394 .PD 0
3395 .IP u
3396 underline
3397 .IP b
3398 bold
3399 .IP r
3400 reverse
3401 .IP s
3402 standout
3403 .IP B
3404 blinking
3407 Colors are coded either as a hexadecimal number or two letters specifying
3408 the desired background and foreground color (in that order). The following
3409 colors are known:
3410 .IP k
3411 black
3412 .PD 0
3413 .IP r
3415 .IP g
3416 green
3417 .IP y
3418 yellow
3419 .IP b
3420 blue
3421 .IP m
3422 magenta
3423 .IP c
3424 cyan
3425 .IP w
3426 white
3427 .IP d
3428 default color
3429 .IP .
3430 leave color unchanged
3433 The capitalized versions of the letter specify bright colors. You can also
3434 use the pseudo-color 'i' to set just the brightness and leave the color
3435 unchanged.
3437 A one digit/letter color description is treated as foreground or
3438 background color dependent on the current attributes: if reverse mode is
3439 set, the background color is changed instead of the foreground color.
3440 If you don't like this, prefix the color with a \*Q.\*U. If you want
3441 the same behavior for two-letter color descriptions, also prefix them
3442 with a \*Q.\*U.
3444 As a special case, \*Q%{-}\*U restores the attributes and colors that
3445 were set before the last change was made (i.e., pops one level of the
3446 color-change stack).
3448 Examples:
3449 .IP "\*QG\*U"
3450 set color to bright green
3451 .IP "\*Q+b r\*U"
3452 use bold red
3453 .IP "\*Q= yd\*U"
3454 clear all attributes, write in default color on yellow background.
3455 .IP "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
3456 The available windows centered at the current window and truncated to
3457 the available width. The current window is displayed white on blue.
3458 This can be used with \*Qhardstatus alwayslastline\*U.
3459 .IP "%?%F%{.R.}%?%3n %t%? [%h]%?"
3460 The window number and title and the window's hardstatus, if one is set.
3461 Also use a red background if this is the active focus. Useful for
3462 \*Qcaption string\*U.
3463 .SH "FLOW-CONTROL"
3464 Each window has a flow-control setting that determines how
3465 .I screen
3466 deals with
3467 the XON and XOFF characters (and perhaps the interrupt character).
3468 When flow-control is turned off,
3469 .I screen
3470 ignores the XON and XOFF characters,
3471 which allows the user to send them to the current program by simply typing
3472 them (useful for the \fIemacs\fP editor, for instance).
3473 The trade-off is that it will take longer for output from a \*Qnormal\*U
3474 program to pause in response to an XOFF.
3475 With flow-control turned on, XON and XOFF characters are used to immediately
3476 pause the output of the current window.
3477 You can still send these characters to the current program, but you must use
3478 the appropriate two-character
3479 .I screen
3480 commands (typically \*QC-a q\*U (xon)
3481 and \*QC-a s\*U (xoff)).
3482 The xon/xoff commands are also useful for typing C-s and C-q past a terminal
3483 that intercepts these characters.
3485 Each window has an initial flow-control value set with either the
3486 .B \-f
3487 option or the \*Qdefflow\*U .screenrc command. Per default the windows
3488 are set to automatic flow-switching.
3489 It can then be toggled between the three states 'fixed on', 'fixed off'
3490 and 'automatic' interactively with the \*Qflow\*U command bound to "C-a f".
3492 The automatic flow-switching mode deals with
3493 flow control using the TIOCPKT mode (like \*Qrlogin\*U does). If
3494 the tty driver does not support TIOCPKT,
3495 .I screen
3496 tries to find out
3497 the right mode based on the current setting of the application
3498 keypad \- when it is enabled, flow-control is turned off and visa versa.
3499 Of course, you can still manipulate flow-control manually when needed.
3501 If you're running with flow-control enabled and find that pressing the
3502 interrupt key (usually C-c) does not interrupt the display until another
3503 6-8 lines have scrolled by, try running
3504 .I screen
3505 with the \*Qinterrupt\*U
3506 option (add the \*Qinterrupt\*U flag to the \*Qflow\*U command in
3507 your .screenrc, or use the
3508 .B \-i
3509 command-line option).
3510 This causes the output that
3511 .I screen
3512 has accumulated from the interrupted program to be flushed.
3513 One disadvantage is that the virtual terminal's memory contains the
3514 non-flushed version of the output, which in rare cases can cause
3515 minor inaccuracies in the output.
3516 For example, if you switch screens and return, or update the screen
3517 with \*QC-a l\*U you would see the version of the output you would
3518 have gotten without \*Qinterrupt\*U being on.
3519 Also, you might need to turn off flow-control (or use auto-flow mode to turn
3520 it off automatically) when running a program that expects you to type the
3521 interrupt character as input, as it is possible to interrupt
3522 the output of the virtual terminal to your physical terminal when flow-control
3523 is enabled.
3524 If this happens, a simple refresh of the screen with \*QC-a l\*U will
3525 restore it.
3526 Give each mode a try, and use whichever mode you find more comfortable.
3529 .SH "TITLES (naming windows)"
3530 You can customize each window's name in the window display (viewed with the
3531 \*Qwindows\*U command (C-a w)) by setting it with one of
3532 the title commands.
3533 Normally the name displayed is the actual command name of the program
3534 created in the window.
3535 However, it is sometimes useful to distinguish various programs of the same
3536 name or to change the name on-the-fly to reflect the current state of
3537 the window.
3539 The default name for all shell windows can be set with the \*Qshelltitle\*U
3540 command in the .screenrc file, while all other windows are created with
3541 a \*Qscreen\*U command and thus can have their name set with the
3542 .B \-t
3543 option.
3544 Interactively, there is the title-string escape-sequence
3545 (<esc>k\fIname\fP<esc>\e) and the \*Qtitle\*U command (C-a A).
3546 The former can be output from an application to control the window's name
3547 under software control, and the latter will prompt for a name when typed.
3548 You can also bind pre-defined names to keys with the \*Qtitle\*U command
3549 to set things quickly without prompting.
3551 Finally,
3552 .I screen
3553 has a shell-specific heuristic that is enabled by setting the window's name
3554 to \*Q\fIsearch|name\fP\*U and arranging to have a null title escape-sequence
3555 output as a part of your prompt.
3556 The \fIsearch\fP portion specifies an end-of-prompt search string, while
3557 the \fIname\fP portion specifies the default shell name for the window.
3558 If the \fIname\fP ends in a `:'
3559 .I screen
3560 will add what it believes to be the current command running in the window
3561 to the end of the window's shell name (e.\|g. \*Q\fIname:cmd\fP\*U).
3562 Otherwise the current command name supersedes the shell name while it is
3563 running.
3565 Here's how it works:  you must modify your shell prompt to output a null
3566 title-escape-sequence (<esc>k<esc>\e) as a part of your prompt.
3567 The last part of your prompt must be the same as the string you specified
3568 for the \fIsearch\fP portion of the title.
3569 Once this is set up,
3570 .I screen
3571 will use the title-escape-sequence to clear the previous command name and
3572 get ready for the next command.
3573 Then, when a newline is received from the shell, a search is made for the
3574 end of the prompt.
3575 If found, it will grab the first word after the matched string and use it
3576 as the command name.
3577 If the command name begins with either '!', '%', or '^'
3578 .I screen
3579 will use the first word on the following line (if found) in preference to
3580 the just-found name.
3581 This helps csh users get better command names when using job control or
3582 history recall commands.
3584 Here's some .screenrc examples:
3586 screen -t top 2 nice top
3588 Adding this line to your .screenrc would start a nice-d version of the
3589 \*Qtop\*U command in window 2 named \*Qtop\*U rather than \*Qnice\*U.
3592         shelltitle '> |csh'
3593         screen 1
3596 These commands would start a shell with the given shelltitle.
3597 The title specified is an auto-title that would expect the prompt and
3598 the typed command to look something like the following:
3600 /usr/joe/src/dir> trn
3602 (it looks after the '> ' for the command name).
3603 The window status would show the name \*Qtrn\*U while the command was
3604 running, and revert to \*Qcsh\*U upon completion.
3606 bind R screen -t '% |root:' su
3608 Having this command in your .screenrc would bind the key
3609 sequence \*QC-a R\*U to the \*Qsu\*U command and give it an
3610 auto-title name of \*Qroot:\*U.
3611 For this auto-title to work, the screen could look something
3612 like this:
3615         % !em
3616         emacs file.c
3619 Here the user typed the csh history command \*Q!em\*U which ran the
3620 previously entered \*Qemacs\*U command.
3621 The window status would show \*Qroot:emacs\*U during the execution
3622 of the command, and revert to simply \*Qroot:\*U at its completion.
3625         bind o title
3626         bind E title ""
3627         bind u title (unknown)
3630 The first binding doesn't have any arguments, so it would prompt you
3631 for a title. when you type \*QC-a o\*U.
3632 The second binding would clear an auto-title's current setting (C-a E).
3633 The third binding would set the current window's title to \*Q(unknown)\*U
3634 (C-a u).
3636 One thing to keep in mind when adding a null title-escape-sequence to
3637 your prompt is that some shells (like the csh) count all the non-control
3638 characters as part of the prompt's length.
3639 If these invisible characters aren't a multiple of 8 then backspacing over
3640 a tab will result in an incorrect display.
3641 One way to get around this is to use a prompt like this:
3643 set prompt='^[[0000m^[k^[\e% '
3645 The escape-sequence \*Q<esc>[0000m\*U not only normalizes the character
3646 attributes, but all the zeros round the length of the invisible characters
3647 up to 8.
3648 Bash users will probably want to echo the escape sequence in the
3649 PROMPT_COMMAND:
3651 PROMPT_COMMAND='printf "\e033k\e033\e134"'
3653 (I used \*Q\134\*U to output a `\e' because of a bug in bash v1.04).
3656 .SH "THE VIRTUAL TERMINAL"
3657 Each window in a 
3658 .I screen
3659 session emulates a VT100 terminal, with some extra functions added. The
3660 VT100 emulator is hard-coded, no other terminal types can be emulated.
3662 Usually
3663 .I screen
3664 tries to emulate as much of the VT100/ANSI standard
3665 as possible. But if your terminal lacks certain capabilities,
3666 the emulation may not be complete. In these cases
3667 .I screen
3668 has to tell the applications that some of the features
3669 are missing. This is no problem on machines using termcap,
3670 because
3671 .I screen
3672 can use the $TERMCAP variable to
3673 customize the standard
3674 .I screen
3675 termcap.
3677 But if you do a
3678 rlogin on another machine or your machine supports only
3679 terminfo this method fails. Because of this,
3680 .I screen
3681 offers a way to deal with these cases. 
3682 Here is how it works:
3684 When 
3685 .I screen
3686 tries to figure out a terminal name for itself,
3687 it first looks
3688 for an entry named \*Qscreen.<term>\*U, where <term> is
3689 the contents of your $TERM variable.
3690 If no such entry exists,
3691 .I screen
3692 tries \*Qscreen\*U (or \*Qscreen-w\*U if the terminal is wide
3693 (132 cols or more)).
3694 If even this entry cannot be found, \*Qvt100\*U is used as a
3695 substitute.
3697 The idea is that if you have a terminal which doesn't
3698 support an important feature (e.g. delete char or clear to EOS)
3699 you can build a new termcap/terminfo entry for
3700 .I screen
3701 (named \*Qscreen.<dumbterm>\*U) in which this capability
3702 has been disabled. If this entry is installed on your
3703 machines you are able to do
3704 a rlogin and still keep the correct termcap/terminfo entry.
3705 The terminal name is put in the $TERM variable
3706 of all new windows.
3707 .I Screen
3708 also sets the $TERMCAP variable reflecting the capabilities
3709 of the virtual terminal emulated. Notice that, however, on machines
3710 using the terminfo database this variable has no effect.
3711 Furthermore, the variable $WINDOW is set to the window number
3712 of each window.
3714 The actual set of capabilities supported by the virtual terminal
3715 depends on the capabilities supported by the physical terminal.
3716 If, for instance, the physical terminal does not support underscore mode,
3717 .I screen
3718 does not put the `us' and `ue' capabilities into the window's $TERMCAP
3719 variable, accordingly.
3720 However, a minimum number of capabilities must be supported by a
3721 terminal in order to run
3722 .IR screen ;
3723 namely scrolling, clear screen, and direct cursor addressing
3724 (in addition,
3725 .I screen
3726 does not run on hardcopy terminals or on terminals that over-strike).
3728 Also, you can customize the $TERMCAP value used by
3729 .I screen
3730 by using the \*Qtermcap\*U .screenrc command, or
3731 by defining the variable $SCREENCAP prior to startup.
3732 When the is latter defined, its value will be copied verbatim into each
3733 window's $TERMCAP variable.
3734 This can either be the full terminal definition, or a filename where the
3735 terminal \*Qscreen\*U (and/or \*Qscreen-w\*U) is defined.
3737 Note that 
3738 .I screen
3739 honors the \*Qterminfo\*U .screenrc command if the system uses the
3740 terminfo database rather than termcap.
3742 When the boolean `G0' capability is present in the termcap entry
3743 for the terminal on which
3744 .I screen
3745 has been called, the terminal emulation of
3746 .I screen
3747 supports multiple character sets.
3748 This allows an application to make use of, for instance,
3749 the VT100 graphics character set or national character sets.
3750 The following control functions from ISO 2022 are supported:
3751 \fIlock shift G0\fP (\fISI\fP), \fIlock shift G1\fP (\fISO\fP),
3752 \fIlock shift G2\fP, \fIlock shift G3\fP, \fIsingle shift G2\fP,
3753 and \fIsingle shift G3\fP.
3754 When a virtual terminal is created or reset, the ASCII character
3755 set is designated as \fIG0\fP through \fIG3\fP.
3756 When the `G0' capability is present,
3757 .I screen
3758 evaluates the capabilities
3759 `S0', `E0', and `C0' if present. `S0' is the sequence the terminal uses
3760 to enable and start the graphics character set rather than \fISI\fP. 
3761 `E0' is the corresponding replacement for \fISO\fP. `C0' gives a character
3762 by character translation string that is used during semi-graphics mode. This 
3763 string is built like the `acsc' terminfo capability.
3765 When the `po' and `pf' capabilities are present in the terminal's
3766 termcap entry, applications running in a
3767 .I screen
3768 window can send output to the printer port of the terminal.
3769 This allows a user to have an application in one window
3770 sending output to a printer connected to the terminal, while all
3771 other windows are still active (the printer port is enabled
3772 and disabled again for each chunk of output).
3773 As a side-effect, programs running in different windows can
3774 send output to the printer simultaneously.
3775 Data sent to the printer is not displayed in the window.  The 
3776 .I info
3777 command displays a line starting `PRIN' while the printer is active.
3779 .I Screen
3780 maintains a hardstatus line for every window. If a window
3781 gets selected, the display's hardstatus will be updated to match
3782 the window's hardstatus line. If the display has no hardstatus
3783 the line will be displayed as a standard 
3784 .I screen 
3785 message.
3786 The hardstatus line can be changed with the ANSI Application
3787 Program Command (APC): \*QESC_<string>ESC\e\*U. As a convenience
3788 for xterm users the sequence \*QESC]0..2;<string>^G\*U is
3789 also accepted.
3791 Some capabilities are only put into the $TERMCAP
3792 variable of the virtual terminal if they can be efficiently
3793 implemented by the physical terminal.
3794 For instance, `dl' (delete line) is only put into the $TERMCAP
3795 variable if the terminal supports either delete line itself or
3796 scrolling regions. Note that this may provoke confusion, when 
3797 the session is reattached on a different terminal, as the value
3798 of $TERMCAP cannot be modified by parent processes.
3800 The "alternate screen" capability is not enabled by default.
3801 Set the \fBaltscreen\fP .screenrc command to enable it.
3803 The following is a list of control sequences recognized by
3804 .IR screen .
3805 \*Q(V)\*U and \*Q(A)\*U indicate VT100-specific and ANSI- or
3806 ISO-specific functions, respectively.
3808 .ta 22n
3809 .TP 27
3810 .B "ESC E"
3811 Next Line
3812 .TP 27
3813 .B "ESC D"
3814 Index
3815 .TP 27
3816 .B "ESC M"
3817 Reverse Index
3818 .TP 27
3819 .B "ESC H"
3820 Horizontal Tab Set
3821 .TP 27
3822 .B "ESC Z"
3823 Send VT100 Identification String
3824 .TP 27
3825 .BR "ESC 7" "   (V)"
3826 Save Cursor and Attributes
3827 .TP 27
3828 .BR "ESC 8" "   (V)"
3829 Restore Cursor and Attributes
3830 .TP 27
3831 .BR "ESC [s" "  (A)"
3832 Save Cursor and Attributes
3833 .TP 27
3834 .BR "ESC [u" "  (A)"
3835 Restore Cursor and Attributes
3836 .TP 27
3837 .B "ESC c"
3838 Reset to Initial State
3839 .TP 27
3840 .B "ESC g"
3841 Visual Bell
3842 .TP 27
3843 .B "ESC \fPPn\fB p"
3844 Cursor Visibility (97801)
3845 .TP 27
3846 \h'\w'ESC 'u'Pn = \fB6\fP
3847 Invisible
3848 .TP 27
3849 \h'\w'ESC Pn = 'u'\fB7\fP
3850 Visible
3851 .TP 27
3852 .BR "ESC =" "   (V)"
3853 Application Keypad Mode
3854 .TP 27
3855 .BR "ESC >" "   (V)"
3856 Numeric Keypad Mode
3857 .TP 27
3858 .BR "ESC # 8" " (V)"
3859 Fill Screen with E's
3860 .TP 27
3861 .BR "ESC \e" "  (A)"
3862 String Terminator
3863 .TP 27
3864 .BR "ESC ^" "   (A)"
3865 Privacy Message String (Message Line)
3866 .TP 27
3867 .B "ESC !"
3868 Global Message String (Message Line)
3869 .TP 27
3870 .B "ESC k"
3871 A.\|k.\|a. Definition String
3872 .TP 27
3873 .BR "ESC P" "   (A)"
3874 Device Control String.
3875 Outputs a string directly to the host
3876 terminal without interpretation.
3877 .TP 27
3878 .BR "ESC _" "   (A)"
3879 Application Program Command (Hardstatus)
3880 .TP 27
3881 .BR "ESC ] 0 ; string ^G" "     (A)"
3882 Operating System Command (Hardstatus, xterm title hack)
3883 .TP 27
3884 .BR "ESC ] 83 ; cmd ^G" "       (A)"
3885 Execute screen command. This only works if multi-user support is
3886 compiled into screen. The pseudo-user \*Q:window:\*U is used to
3887 check the access control list. Use \*Qaddacl :window: -rwx #?\*U to
3888 create a user with no rights and allow only the needed commands.
3889 .TP 27
3890 .BR "Control-N" "       (A)"
3891 Lock Shift G1 (SO)
3892 .TP 27
3893 .BR "Control-O" "       (A)"
3894 Lock Shift G0 (SI)
3895 .TP 27
3896 .BR "ESC n" "   (A)"
3897 Lock Shift G2
3898 .TP 27
3899 .BR "ESC o" "   (A)"
3900 Lock Shift G3
3901 .TP 27
3902 .BR "ESC N" "   (A)"
3903 Single Shift G2
3904 .TP 27
3905 .BR "ESC O" "   (A)"
3906 Single Shift G3
3907 .TP 27
3908 .BR "ESC ( \fPPcs" "    (A)"
3909 Designate character set as G0
3910 .TP 27
3911 .BR "ESC ) \fPPcs" "    (A)"
3912 Designate character set as G1
3913 .TP 27
3914 .BR "ESC * \fPPcs" "    (A)"
3915 Designate character set as G2
3916 .TP 27
3917 .BR "ESC + \fPPcs" "    (A)"
3918 Designate character set as G3
3919 .TP 27
3920 .B "ESC [ \fPPn\fB ; \fPPn\fB H"
3921 Direct Cursor Addressing
3922 .TP 27
3923 .B "ESC [ \fPPn\fB ; \fPPn\fB f"
3924 same as above
3925 .TP 27
3926 .B "ESC [ \fPPn\fB J"
3927 Erase in Display
3928 .TP 27
3929 \h'\w'ESC [ 'u'Pn = None or \fB0\fP
3930 From Cursor to End of Screen
3931 .TP 27
3932 \h'\w'ESC [ Pn = 'u'\fB1\fP
3933 From Beginning of Screen to Cursor
3934 .TP 27
3935 \h'\w'ESC [ Pn = 'u'\fB2\fP
3936 Entire Screen
3937 .TP 27
3938 .B "ESC [ \fPPn\fB K"
3939 Erase in Line
3940 .TP 27
3941 \h'\w'ESC [ 'u'Pn = None or \fB0\fP
3942 From Cursor to End of Line
3943 .TP 27
3944 \h'\w'ESC [ Pn = 'u'\fB1\fP
3945 From Beginning of Line to Cursor
3946 .TP 27
3947 \h'\w'ESC [ Pn = 'u'\fB2\fP
3948 Entire Line
3949 .TP 27
3950 .B "ESC [ \fPPn\fB X"
3951 Erase character
3952 .TP 27
3953 .B "ESC [ \fPPn\fB A"
3954 Cursor Up
3955 .TP 27
3956 .B "ESC [ \fPPn\fB B"
3957 Cursor Down
3958 .TP 27
3959 .B "ESC [ \fPPn\fB C"
3960 Cursor Right
3961 .TP 27
3962 .B "ESC [ \fPPn\fB D"
3963 Cursor Left
3964 .TP 27
3965 .B "ESC [ \fPPn\fB E"
3966 Cursor next line
3967 .TP 27
3968 .B "ESC [ \fPPn\fB F"
3969 Cursor previous line
3970 .TP 27
3971 .B "ESC [ \fPPn\fB G"
3972 Cursor horizontal position
3973 .TP 27
3974 .B "ESC [ \fPPn\fB `"
3975 same as above
3976 .TP 27
3977 .B "ESC [ \fPPn\fB d"
3978 Cursor vertical position
3979 .TP 27
3980 .B "ESC [ \fPPs\fB ;\fP...\fB; \fPPs\fB m"
3981 Select Graphic Rendition
3982 .TP 27
3983 \h'\w'ESC [ 'u'Ps = None or \fB0\fP
3984 Default Rendition
3985 .TP 27
3986 \h'\w'ESC [ Ps = 'u'\fB1\fP
3987 Bold
3988 .TP 27
3989 \h'\w'ESC [ Ps = 'u'\fB2\fP     (A)
3990 Faint
3991 .TP 27
3992 \h'\w'ESC [ Ps = 'u'\fB3\fP     (A)
3993 \fIStandout\fP Mode (ANSI: Italicized)
3994 .TP 27
3995 \h'\w'ESC [ Ps = 'u'\fB4\fP
3996 Underlined
3997 .TP 27
3998 \h'\w'ESC [ Ps = 'u'\fB5\fP
3999 Blinking
4000 .TP 27
4001 \h'\w'ESC [ Ps = 'u'\fB7\fP
4002 Negative Image
4003 .TP 27
4004 \h'\w'ESC [ Ps = 'u'\fB22\fP    (A)
4005 Normal Intensity
4006 .TP 27
4007 \h'\w'ESC [ Ps = 'u'\fB23\fP    (A)
4008 \fIStandout\fP Mode off (ANSI: Italicized off)
4009 .TP 27
4010 \h'\w'ESC [ Ps = 'u'\fB24\fP    (A)
4011 Not Underlined
4012 .TP 27
4013 \h'\w'ESC [ Ps = 'u'\fB25\fP    (A)
4014 Not Blinking
4015 .TP 27
4016 \h'\w'ESC [ Ps = 'u'\fB27\fP    (A)
4017 Positive Image
4018 .TP 27
4019 \h'\w'ESC [ Ps = 'u'\fB30\fP    (A)
4020 Foreground Black
4021 .TP 27
4022 \h'\w'ESC [ Ps = 'u'\fB31\fP    (A)
4023 Foreground Red
4024 .TP 27
4025 \h'\w'ESC [ Ps = 'u'\fB32\fP    (A)
4026 Foreground Green
4027 .TP 27
4028 \h'\w'ESC [ Ps = 'u'\fB33\fP    (A)
4029 Foreground Yellow
4030 .TP 27
4031 \h'\w'ESC [ Ps = 'u'\fB34\fP    (A)
4032 Foreground Blue
4033 .TP 27
4034 \h'\w'ESC [ Ps = 'u'\fB35\fP    (A)
4035 Foreground Magenta
4036 .TP 27
4037 \h'\w'ESC [ Ps = 'u'\fB36\fP    (A)
4038 Foreground Cyan
4039 .TP 27
4040 \h'\w'ESC [ Ps = 'u'\fB37\fP    (A)
4041 Foreground White
4042 .TP 27
4043 \h'\w'ESC [ Ps = 'u'\fB39\fP    (A)
4044 Foreground Default
4045 .TP 27
4046 \h'\w'ESC [ Ps = 'u'\fB40\fP    (A)
4047 Background Black
4048 .TP 27
4049 \h'\w'ESC [ Ps = 'u'\fB...\fP
4051 .TP 27
4052 \h'\w'ESC [ Ps = 'u'\fB49\fP    (A)
4053 Background Default
4054 .TP 27
4055 .B "ESC [ \fPPn\fB g"
4056 Tab Clear
4057 .TP 27
4058 \h'\w'ESC [ 'u'Pn = None or \fB0\fP
4059 Clear Tab at Current Position
4060 .TP 27
4061 \h'\w'ESC [ Ps = 'u'\fB3\fP
4062 Clear All Tabs
4063 .TP 27
4064 .BR "ESC [ \fPPn\fB ; \fPPn\fB r" "     (V)"
4065 Set Scrolling Region
4066 .TP 27
4067 .BR "ESC [ \fPPn\fB I" "        (A)"
4068 Horizontal Tab
4069 .TP 27
4070 .BR "ESC [ \fPPn\fB Z" "        (A)"
4071 Backward Tab
4072 .TP 27
4073 .BR "ESC [ \fPPn\fB L" "        (A)"
4074 Insert Line
4075 .TP 27
4076 .BR "ESC [ \fPPn\fB M" "        (A)"
4077 Delete Line
4078 .TP 27
4079 .BR "ESC [ \fPPn\fB @" "        (A)"
4080 Insert Character
4081 .TP 27
4082 .BR "ESC [ \fPPn\fB P" "        (A)"
4083 Delete Character
4084 .TP 27
4085 .B "ESC [ \fPPn\fB S"
4086 Scroll Scrolling Region Up
4087 .TP 27
4088 .B "ESC [ \fPPn\fB T"
4089 Scroll Scrolling Region Down
4090 .TP 27
4091 .B "ESC [ \fPPn\fB ^"
4092 same as above
4093 .TP 27
4094 .B "ESC [ \fPPs\fB ;\fP...\fB; \fPPs\fB h"
4095 Set Mode
4096 .TP 27
4097 .B "ESC [ \fPPs\fB ;\fP...\fB; \fPPs\fB l"
4098 Reset Mode
4099 .TP 27
4100 \h'\w'ESC [ 'u'Ps = \fB4\fP     (A)
4101 Insert Mode
4102 .TP 27
4103 \h'\w'ESC [ Ps = 'u'\fB20\fP    (A)
4104 \fIAutomatic Linefeed\fP Mode
4105 .TP 27
4106 \h'\w'ESC [ Ps = 'u'\fB34\fP
4107 Normal Cursor Visibility
4108 .TP 27
4109 \h'\w'ESC [ Ps = 'u'\fB?1\fP    (V)
4110 Application Cursor Keys
4111 .TP 27
4112 \h'\w'ESC [ Ps = 'u'\fB?3\fP    (V)
4113 Change Terminal Width to 132 columns
4114 .TP 27
4115 \h'\w'ESC [ Ps = 'u'\fB?5\fP    (V)
4116 Reverse Video
4117 .TP 27
4118 \h'\w'ESC [ Ps = 'u'\fB?6\fP    (V)
4119 \fIOrigin\fP Mode
4120 .TP 27
4121 \h'\w'ESC [ Ps = 'u'\fB?7\fP    (V)
4122 \fIWrap\fP Mode
4123 .TP 27
4124 \h'\w'ESC [ Ps = 'u'\fB?9\fP
4125 X10 mouse tracking
4126 .TP 27
4127 \h'\w'ESC [ Ps = 'u'\fB?25\fP   (V)
4128 Visible Cursor
4129 .TP 27
4130 \h'\w'ESC [ Ps = 'u'\fB?47\fP
4131 Alternate Screen (old xterm code)
4132 .TP 27
4133 \h'\w'ESC [ Ps = 'u'\fB?1000\fP (V)
4134 VT200 mouse tracking
4135 .TP 27
4136 \h'\w'ESC [ Ps = 'u'\fB?1047\fP
4137 Alternate Screen (new xterm code)
4138 .TP 27
4139 \h'\w'ESC [ Ps = 'u'\fB?1049\fP
4140 Alternate Screen (new xterm code)
4141 .TP 27
4142 .BR "ESC [ 5 i" "       (A)"
4143 Start relay to printer (ANSI Media Copy)
4144 .TP 27
4145 .BR "ESC [ 4 i" "       (A)"
4146 Stop relay to printer (ANSI Media Copy)
4147 .TP 27
4148 .B "ESC [ 8 ; \fPPh\fB ; \fPPw\fB t"
4149 Resize the window to `Ph' lines and `Pw' columns (SunView special)
4150 .TP 27
4151 .B "ESC [ c"
4152 Send VT100 Identification String
4153 .TP 27
4154 .B "ESC [ x"
4155 Send Terminal Parameter Report
4156 .TP 27
4157 .B "ESC [ > c"
4158 Send VT220 Secondary Device Attributes String
4159 .TP 27
4160 .B "ESC [ 6 n"
4161 Send Cursor Position Report
4164 .SH "INPUT TRANSLATION"
4165 In order to do a full VT100 emulation 
4166 .I screen
4167 has to detect
4168 that a sequence of characters in the input stream was generated
4169 by a keypress on the user's keyboard and insert the VT100
4170 style escape sequence. \fIScreen\fP has a very flexible way of doing
4171 this by making it possible to map arbitrary commands on arbitrary
4172 sequences of characters. For standard VT100 emulation the command
4173 will always insert a string in the input buffer of the window
4174 (see also command \fBstuff\fP in the command table).
4175 Because the sequences generated by a keypress can
4176 change after a reattach from a different terminal type, it is
4177 possible to bind commands to the termcap name of the keys.
4178 \fIScreen\fP will insert the correct binding after each
4179 reattach. See the \fBbindkey\fP command for further details on the
4180 syntax and examples.
4182 Here is the table of the default key bindings. (A) means that the
4183 command is executed if the keyboard is switched into application
4184 mode.
4186 .ta 18n 34n 50n
4188 Key name        Termcap name    Command
4189 \l'54n'
4190 .ta 22n 34n 50n
4191 Cursor up       ku      stuff \e033[A
4192                 stuff \e033OA   (A)
4193 Cursor down     kd      stuff \e033[B
4194                 stuff \e033OB   (A)
4195 Cursor right    kr      stuff \e033[C
4196                 stuff \e033OC   (A)
4197 Cursor left     kl      stuff \e033[D
4198                 stuff \e033OD   (A)
4199 Function key 0  k0      stuff \e033[10~
4200 Function key 1  k1      stuff \e033OP
4201 Function key 2  k2      stuff \e033OQ
4202 Function key 3  k3      stuff \e033OR
4203 Function key 4  k4      stuff \e033OS
4204 Function key 5  k5      stuff \e033[15~
4205 Function key 6  k6      stuff \e033[17~
4206 Function key 7  k7      stuff \e033[18~
4207 Function key 8  k8      stuff \e033[19~
4208 Function key 9  k9      stuff \e033[20~
4209 Function key 10 k;      stuff \e033[21~
4210 Function key 11 F1      stuff \e033[23~
4211 Function key 12 F2      stuff \e033[24~
4212 Home    kh      stuff \e033[1~
4213 End     kH      stuff \e033[4~
4214 Insert  kI      stuff \e033[2~
4215 Delete  kD      stuff \e033[3~
4216 Page up kP      stuff \e033[5~
4217 Page down       kN      stuff \e033[6~
4218 Keypad 0        f0      stuff 0
4219                 stuff \e033Op   (A)
4220 Keypad 1        f1      stuff 1
4221                 stuff \e033Oq   (A)
4222 Keypad 2        f2      stuff 2
4223                 stuff \e033Or   (A)
4224 Keypad 3        f3      stuff 3
4225                 stuff \e033Os   (A)
4226 Keypad 4        f4      stuff 4
4227                 stuff \e033Ot   (A)
4228 Keypad 5        f5      stuff 5
4229                 stuff \e033Ou   (A)
4230 Keypad 6        f6      stuff 6
4231                 stuff \e033Ov   (A)
4232 Keypad 7        f7      stuff 7
4233                 stuff \e033Ow   (A)
4234 Keypad 8        f8      stuff 8
4235                 stuff \e033Ox   (A)
4236 Keypad 9        f9      stuff 9
4237                 stuff \e033Oy   (A)
4238 Keypad +        f+      stuff +
4239                 stuff \e033Ok   (A)
4240 Keypad -        f-      stuff -
4241                 stuff \e033Om   (A)
4242 Keypad *        f*      stuff *
4243                 stuff \e033Oj   (A)
4244 Keypad /        f/      stuff /
4245                 stuff \e033Oo   (A)
4246 Keypad =        fq      stuff =
4247                 stuff \e033OX   (A)
4248 Keypad .        f.      stuff .
4249                 stuff \e033On   (A)
4250 Keypad ,        f,      stuff ,
4251                 stuff \e033Ol   (A)
4252 Keypad enter    fe      stuff \e015
4253                 stuff \e033OM   (A)
4257 .SH SPECIAL TERMINAL CAPABILITIES
4258 The following table describes all terminal capabilities
4259 that are recognized by 
4260 .I screen
4261 and are not in the termcap(5) manual.
4262 You can place these capabilities in your termcap entries (in
4263 `/etc/termcap') or use them with the commands `termcap', `terminfo' and
4264 `termcapinfo' in your screenrc files. It is often not possible to place
4265 these capabilities in the terminfo database.
4267 .ta 5n
4268 .TP 13
4269 .BI LP "        (bool)"
4270 Terminal has VT100 style margins (`magic margins'). Note that
4271 this capability is obsolete because 
4272 .I screen
4273 uses the standard 'xn' instead.
4274 .TP 13
4275 .BI Z0 "        (str)"
4276 Change width to 132 columns.
4277 .TP 13
4278 .BI Z1 "        (str)"
4279 Change width to 80 columns.
4280 .TP 13
4281 .BI WS "        (str)"
4282 Resize display. This capability has the desired width and height as
4283 arguments. \fISunView(tm)\fP example: '\eE[8;%d;%dt'.
4284 .TP 13
4285 .BI NF "        (bool)"
4286 Terminal doesn't need flow control. Send ^S and ^Q direct to
4287 the application. Same as 'flow off'. The opposite of this
4288 capability is 'nx'.
4289 .TP 13
4290 .BI G0 "        (bool)"
4291 Terminal can deal with ISO 2022 font selection sequences.
4292 .TP 13
4293 .BI S0 "        (str)"
4294 Switch charset 'G0' to the specified charset. Default
4295 is '\eE(%.'.
4296 .TP 13
4297 .BI E0 "        (str)"
4298 Switch charset 'G0' back to standard charset. Default
4299 is '\eE(B'.
4300 .TP 13
4301 .BI C0 "        (str)"
4302 Use the string as a conversion table for font '0'. See
4303 the 'ac' capability for more details.
4304 .TP 13
4305 .BI CS "        (str)"
4306 Switch cursor-keys to application mode.
4307 .TP 13
4308 .BI CE "        (str)"
4309 Switch cursor-keys back to normal mode.
4310 .TP 13
4311 .BI AN "        (bool)"
4312 Turn on autonuke. See the 'autonuke' command for more details.
4313 .TP 13
4314 .BI OL "        (num)"
4315 Set the output buffer limit. See the 'obuflimit' command for more details.
4316 .TP 13
4317 .BI KJ "        (str)"
4318 Set the encoding of the terminal. See the 'encoding' command for
4319 valid encodings.
4320 .TP 13
4321 .BI AF "        (str)"
4322 Change character foreground color in an ANSI conform way. This
4323 capability will almost always be set to '\eE[3%dm' ('\eE[3%p1%dm'
4324 on terminfo machines).
4325 .TP 13
4326 .BI AB "        (str)"
4327 Same as 'AF', but change background color.
4328 .TP 13
4329 .BI AX "        (bool)"
4330 Does understand ANSI set default fg/bg color (\eE[39m / \eE[49m).
4331 .TP 13
4332 .BI XC "        (str)"
4333 Describe a translation of characters to strings depending on the
4334 current font. More details follow in the next section.
4335 .TP 13
4336 .BI XT "        (bool)"
4337 Terminal understands special xterm sequences (OSC, mouse tracking).
4338 .TP 13
4339 .BI C8 "        (bool)"
4340 Terminal needs bold to display high-intensity colors (e.g. Eterm).
4341 .TP 13
4342 .BI TF "        (bool)"
4343 Add missing capabilities to the termcap/info entry. (Set by default).
4345 .SH CHARACTER TRANSLATION
4346 \fIScreen\fP has a powerful mechanism to translate characters to arbitrary
4347 strings depending on the current font and terminal type.
4348 Use this feature if you want to work with a common standard character
4349 set (say ISO8851-latin1) even on terminals that scatter the more
4350 unusual characters over several national language font pages.
4352 Syntax:
4354     \fBXC=\fP\fI<charset-mapping>\fP{\fB,,\fP\fI<charset-mapping>\fP}
4355     \fI<charset-mapping>\fP := \fI<designator><template>\fP{\fB,\fP\fI<mapping>\fP}
4356     \fI<mapping>\fP := \fI<char-to-be-mapped><template-arg>\fP
4359 The things in braces may be repeated any number of times.
4361 A \fI<charset-mapping>\fP tells 
4362 .I screen
4363 how to map characters
4364 in font \fI<designator>\fP ('B': Ascii, 'A': UK, 'K': German, etc.)
4365 to strings. Every \fI<mapping>\fP describes to what string a single
4366 character will be translated. A template mechanism is used, as 
4367 most of the time the codes have a lot in common (for example
4368 strings to switch to and from another charset). Each occurrence
4369 of '%' in \fI<template>\fP gets substituted with the \fI<template-arg>\fP
4370 specified together with the character. If your strings are not
4371 similar at all, then use '%' as a template and place the full
4372 string in \fI<template-arg>\fP. A quoting mechanism was added to make
4373 it possible to use a real '%'. The '\e' character quotes the
4374 special characters '\e', '%', and ','.
4376 Here is an example:
4378     termcap hp700 'XC=B\eE(K%\eE(B,\e304[,\e326\e\e\e\e,\e334]'
4380 This tells
4381 .I screen
4382 how to translate ISOlatin1 (charset 'B')
4383 upper case umlaut characters on a hp700 terminal that has a
4384 German charset. '\e304' gets translated to '\eE(K[\eE(B' and so on.
4385 Note that this line gets parsed *three* times before the internal
4386 lookup table is built, therefore a lot of quoting is needed to
4387 create a single '\e'.
4389 Another extension was added to allow more emulation: If a mapping
4390 translates the unquoted '%' char, it will be sent to the terminal
4391 whenever 
4392 .I screen
4393 switches to the corresponding \fI<designator>\fP. In this
4394 special case the template is assumed to be just '%' because
4395 the charset switch sequence and the character mappings normally
4396 haven't much in common.
4398 This example shows one use of the extension:
4400     termcap xterm 'XC=K%,%\eE(B,[\e304,\e\e\e\e\e326,]\e334'
4402 Here, a part of the German ('K') charset is emulated on an xterm.
4403 If 
4404 .I screen
4405 has to change to the 'K' charset, '\eE(B' will be sent
4406 to the terminal, i.e. the ASCII charset is used instead. The
4407 template is just '%', so the mapping is straightforward: '['
4408 to '\e304', '\e' to '\e326', and ']' to '\e334'.
4410 .SH ENVIRONMENT
4411 .PD 0
4412 .IP COLUMNS 15
4413 Number of columns on the terminal (overrides termcap entry).
4414 .IP HOME
4415 Directory in which to look for .screenrc.
4416 .IP LINES 
4417 Number of lines on the terminal (overrides termcap entry).
4418 .IP LOCKPRG
4419 Screen lock program.
4420 .IP NETHACKOPTIONS
4421 Turns on nethack option.
4422 .IP PATH
4423 Used for locating programs to run.
4424 .IP SCREENCAP
4425 For customizing a terminal's TERMCAP value.
4426 .IP SCREENDIR
4427 Alternate socket directory.
4428 .IP SCREENRC
4429 Alternate user screenrc file.
4430 .IP SHELL
4431 Default shell program for opening windows (default \*Q/bin/sh\*U).
4432 .IP STY
4433 Alternate socket name.
4434 .IP SYSSCREENRC
4435 Alternate system screenrc file.
4436 .IP TERM
4437 Terminal name.
4438 .IP TERMCAP
4439 Terminal description.
4440 .IP WINDOW
4441 Window number of a window (at creation time).
4443 .SH FILES
4444 .PD 0
4445 .IP .../screen-4.?.??/etc/screenrc 34
4446 .IP .../screen-4.?.??/etc/etcscreenrc
4447 Examples in the 
4448 .I screen
4449 distribution package for private and global initialization files.
4450 .IP $SYSSCREENRC 
4451 .IP /usr/local/etc/screenrc
4452 .I screen
4453 initialization commands
4454 .IP $SCREENRC
4455 .IP $HOME/.screenrc
4456 Read in after /usr/local/etc/screenrc
4457 .IP $SCREENDIR/S-<login>
4458 .IP /local/screens/S-<login>
4459 Socket directories (default)
4460 .IP /usr/tmp/screens/S-<login>
4461 Alternate socket directories.
4462 .IP "<socket directory>/.termcap"
4463 Written by the "termcap" output function
4464 .IP /usr/tmp/screens/screen-exchange
4466 .IP /tmp/screen-exchange
4467 .I screen
4468 `interprocess communication buffer'
4469 .IP hardcopy.[0-9]
4470 Screen images created by the hardcopy function
4471 .IP screenlog.[0-9]
4472 Output log files created by the log function
4473 .IP /usr/lib/terminfo/?/*
4475 .IP /etc/termcap
4476 Terminal capability databases
4477 .IP /etc/utmp
4478 Login records
4479 .IP $LOCKPRG
4480 Program that locks a terminal.
4483 .SH "SEE ALSO"
4484 termcap(5), utmp(5), vi(1), captoinfo(1), tic(1)
4487 .SH AUTHORS
4488 Originally created by Oliver Laumann, this latest version was
4489 produced by Wayne Davison, Juergen Weigert and Michael Schroeder.
4491 .SH COPYLEFT
4493 Copyright (C) 1993-2003
4494         Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
4495         Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
4496 Copyright (C) 1987 Oliver Laumann
4499 This program is free software; you can redistribute it and/or modify
4500 it under the terms of the GNU General Public License as published by
4501 the Free Software Foundation; either version 2, or (at your option)
4502 any later version.
4504 This program is distributed in the hope that it will be useful,
4505 but WITHOUT ANY WARRANTY; without even the implied warranty of
4506 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4507 GNU General Public License for more details.
4509 You should have received a copy of the GNU General Public License
4510 along with this program (see the file COPYING); if not, write to the
4511 Free Software Foundation, Inc.,
4512 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
4514 .SH CONTRIBUTORS
4516 Ken Beal (kbeal@amber.ssd.csd.harris.com),
4517 Rudolf Koenig (rfkoenig@immd4.informatik.uni-erlangen.de),
4518 Toerless Eckert (eckert@immd4.informatik.uni-erlangen.de), 
4519 Wayne Davison (davison@borland.com),
4520 Patrick Wolfe (pat@kai.com, kailand!pat),
4521 Bart Schaefer (schaefer@cse.ogi.edu),
4522 Nathan Glasser (nathan@brokaw.lcs.mit.edu),
4523 Larry W. Virden (lvirden@cas.org),
4524 Howard Chu (hyc@hanauma.jpl.nasa.gov),
4525 Tim MacKenzie (tym@dibbler.cs.monash.edu.au),
4526 Markku Jarvinen (mta@{cc,cs,ee}.tut.fi),
4527 Marc Boucher (marc@CAM.ORG),
4528 Doug Siebert (dsiebert@isca.uiowa.edu),
4529 Ken Stillson (stillson@tsfsrv.mitre.org),
4530 Ian Frechett (frechett@spot.Colorado.EDU),
4531 Brian Koehmstedt (bpk@gnu.ai.mit.edu),
4532 Don Smith (djs6015@ultb.isc.rit.edu),
4533 Frank van der Linden (vdlinden@fwi.uva.nl),
4534 Martin Schweikert (schweik@cpp.ob.open.de),
4535 David Vrona (dave@sashimi.lcu.com),
4536 E. Tye McQueen (tye%spillman.UUCP@uunet.uu.net),
4537 Matthew Green (mrg@eterna.com.au),
4538 Christopher Williams (cgw@pobox.com),
4539 Matt Mosley (mattm@access.digex.net),
4540 Gregory Neil Shapiro (gshapiro@wpi.WPI.EDU),
4541 Johannes Zellner (johannes@zellner.org),
4542 Pablo Averbuj (pablo@averbuj.com).
4546 .SH VERSION
4547 This is version 4.0.2. Its roots are a merge of a custom version
4548 2.3PR7 by Wayne Davison
4549 and several enhancements to Oliver Laumann's version 2.0. Note that all versions
4550 numbered 2.x are copyright by Oliver Laumann. 
4552 .SH AVAILABILITY
4553 The latest official release of 
4554 .I screen
4555 available via anonymous ftp from gnudist.gnu.org, nic.funet.fi or any other 
4556 .I GNU 
4557 distribution site. The home site of
4558 .I screen
4559 is ftp.uni-erlangen.de, in the directory
4560 pub/utilities/screen. The subdirectory `private' contains the latest beta
4561 testing release. If you want to help, send a note to
4562 screen@uni-erlangen.de.
4564 .SH BUGS
4566 .IP \(bu 3
4567 `dm' (delete mode) and `xs' are not handled
4568 correctly (they are ignored). `xn' is treated as a magic-margin
4569 indicator.
4570 .IP \(bu
4571 .I Screen
4572 has no clue about double-high or double-wide characters.         
4573 But this is the only area where 
4574 .I vttest
4575 is allowed to fail.
4576 .IP \(bu
4577 It is not possible to change the environment variable $TERMCAP when 
4578 reattaching under a different terminal type.
4579 .IP \(bu
4580 The support of terminfo based systems is very limited. Adding extra
4581 capabilities to $TERMCAP may not have any effects.
4582 .IP \(bu
4583 .I Screen
4584 does not make use of hardware tabs.
4585 .IP \(bu
4586 .I Screen
4587 must be installed as set-uid with owner root on most systems in order
4588 to be able to correctly change the owner of the tty device file for
4589 each window.
4590 Special permission may also be required to write the file \*Q/etc/utmp\*U.
4591 .IP \(bu
4592 Entries in \*Q/etc/utmp\*U are not removed when
4593 .I screen
4594 is killed with SIGKILL.
4595 This will cause some programs (like "w" or "rwho")
4596 to advertise that a user is logged on who really isn't.
4597 .IP \(bu
4598 .I Screen
4599 may give a strange warning when your tty has no utmp entry.
4600 .IP \(bu
4601 When the modem line was hung up, 
4602 .I screen
4603 may not automatically detach (or quit)
4604 unless the device driver is configured to send a HANGUP signal. 
4605 To detach a 
4606 .I screen
4607 session use the -D or -d command line option.
4608 .IP \(bu
4609 If a password is set, the command line options -d and -D still detach a 
4610 session without asking.
4611 .IP \(bu
4612 Both \*Qbreaktype\*U and \*Qdefbreaktype\*U change the break generating
4613 method used by all terminal devices. The first should change a window
4614 specific setting, where the latter should change only the default for new 
4615 windows.
4616 .IP \(bu
4617 When attaching to a multiuser session, the user's .screenrc file is not
4618 sourced. Each user's personal settings have to be included in the .screenrc
4619 file from which the session is booted, or have to be changed manually.
4620 .IP \(bu
4621 A weird imagination is most useful to gain full advantage of all the features.
4622 .IP \(bu
4623 Send bug-reports, fixes, enhancements, t-shirts, money, beer & pizza to
4624 .BR screen@uni-erlangen.de .