Annotation of 43BSDReno/usr.bin/window/window.1, revision 1.1.1.1

1.1       root        1: .\" Copyright (c) 1985, 1990 The Regents of the University of California.
                      2: .\" All rights reserved.
                      3: .\"
                      4: .\" This code is derived from software contributed to Berkeley by
                      5: .\" Edward Wang at The University of California, Berkeley.
                      6: .\"
                      7: .\" Redistribution and use in source and binary forms are permitted provided
                      8: .\" that: (1) source distributions retain this entire copyright notice and
                      9: .\" comment, and (2) distributions including binaries display the following
                     10: .\" acknowledgement:  ``This product includes software developed by the
                     11: .\" University of California, Berkeley and its contributors'' in the
                     12: .\" documentation or other materials provided with the distribution and in
                     13: .\" all advertising materials mentioning features or use of this software.
                     14: .\" Neither the name of the University nor the names of its contributors may
                     15: .\" be used to endorse or promote products derived from this software without
                     16: .\" specific prior written permission.
                     17: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
                     18: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
                     19: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     20: .\"
                     21: .\"     @(#)window.1   6.13 (Berkeley) 7/24/90
                     22: .\"
                     23: .Dd July 24, 1990
                     24: .Dt WINDOW 1
                     25: .Os BSD 4.3
                     26: .Sh NAME
                     27: .Nm window
                     28: .Nd window environment
                     29: .Sh SYNOPSIS
                     30: .Nm window
                     31: .Op Fl t
                     32: .Op Fl f
                     33: .Op Fl d
                     34: .Op Fl e Ar escape-char
                     35: .Op Fl c Ar command
                     36: .Sh DESCRIPTION
                     37: .Nm Window
                     38: implements a window environment on
                     39: ASCII terminals.
                     40: .Pp
                     41: A window is a rectangular portion of the physical terminal
                     42: screen associated with a set of processes.  Its size and
                     43: position can be changed by the user at any time.  Processes
                     44: communicate with their window in the same way they normally
                     45: interact with a terminal\-through their standard input, output,
                     46: and diagnostic file descriptors.  The window program handles the
                     47: details of redirecting input an output to and from the
                     48: windows.  At any one time, only one window can receive
                     49: input from the keyboard, but all windows can simultaneously send output
                     50: to the display.
                     51: .Pp
                     52: When
                     53: .Nm window
                     54: starts up, the commands (see long commands below)
                     55: contained in the file
                     56: .Pa .windowrc
                     57: in the user's home directory are
                     58: executed.  If it does not exist, two equal sized windows spanning
                     59: the terminal screen are created by default.
                     60: .Pp
                     61: The command line options are
                     62: .Tw Fl
                     63: .Tp Fl t
                     64: Turn on terse mode (see
                     65: .Ic terse
                     66: command below).
                     67: .Tp Fl f
                     68: Fast.  Don't perform any startup action.
                     69: .Tp Fl d
                     70: Ignore
                     71: .Pa .windowrc
                     72: and create the two default
                     73: windows instead.
                     74: .Tp Cx Fl e
                     75: .Cx \&\ \&
                     76: .Ar escape-char
                     77: .Cx
                     78: Set the escape character to
                     79: .Ar escape-char  .
                     80: .Ar Escape-char
                     81: can be a single character, or in the form
                     82: .Ic ^X
                     83: where
                     84: .Ar X
                     85: is any character, meaning
                     86: .Cx control\-
                     87: .Ar X  .
                     88: .Cx
                     89: .Tp Cx Fl c
                     90: .Cx \&\ \&
                     91: .Ar command
                     92: .Cx
                     93: Execute the string
                     94: .Ar command
                     95: as a long command (see below)
                     96: before doing anything else.
                     97: .Tp
                     98: .Pp
                     99: Windows can overlap and are framed as necessary.  Each window
                    100: is named by one of the digits ``1'' to ``9''.  This one-character
                    101: identifier, as well as a user definable label string, are displayed
                    102: with the window on the top edge of its frame.  A window can be
                    103: designated to be in the
                    104: .Ar foreground  ,
                    105: in which case it will always be
                    106: on top of all normal, non-foreground windows, and can be covered
                    107: only by other foreground windows.  A window need not be completely
                    108: within the edges of the terminal screen.  Thus a large window
                    109: (possibly larger than the screen) may be positioned to show only
                    110: a portion of its full size.
                    111: .Pp
                    112: Each window has a cursor and a set of control functions.  Most intelligent
                    113: terminal operations such as line and
                    114: character deletion and insertion are supported.  Display modes
                    115: such as underlining and reverse video are available if they are
                    116: supported by the terminal.  In addition,
                    117: similar to terminals with multiple pages of memory,
                    118: each window has a text buffer which can have more lines than the window
                    119: itself.
                    120: .Ss Process Environment
                    121: With each newly created window, a shell program is spawned with its
                    122: process environment tailored to that window.  Its standard input,
                    123: output, and diagnostic file descriptors are bound to one end of either
                    124: a pseudo-terminal
                    125: .Xr (pty 4 )
                    126: or a UNIX domain socket
                    127: .Xr (socketpair 4 ) .
                    128: If a pseudo-terminal is used, then its special
                    129: characters and modes (see
                    130: .Xr stty 1 )
                    131: are copied from the physical
                    132: terminal.  A
                    133: .Xr termcap 5
                    134: entry tailored to this window is created
                    135: and passed as environment
                    136: .Xr (environ 5 )
                    137: variable
                    138: .Ev TERMCAP  .
                    139: The termcap entry contains the window's size and
                    140: characteristics as well as information from the physical terminal,
                    141: such as the existence of underline, reverse video, and other display
                    142: modes, and the codes produced by the terminal's function keys,
                    143: if any.  In addition, the window size attributes of the pseudo-terminal
                    144: are set to reflect the size of this window, and updated whenever
                    145: it is changed by the user.  In particular, the editor
                    146: .Xr vi 1
                    147: uses
                    148: this information to redraw its display.
                    149: .Ss Operation
                    150: During normal execution,
                    151: .Nm window
                    152: can be in one of two states:
                    153: conversation mode and command mode.  In conversation mode, the
                    154: terminal's real cursor is placed at the cursor position of a particular
                    155: window--called the current window--and input from the keyboard is sent
                    156: to the process in that window.  The current window is always
                    157: on top of all other windows, except those in foreground.  In addition,
                    158: it is set apart by highlighting its identifier and label in reverse video.
                    159: .Pp
                    160: Typing
                    161: .Cx Nm window
                    162: .Cx 's
                    163: .Cx
                    164: escape character (normally
                    165: .Ic ^P )
                    166: in conversation
                    167: mode switches it into command mode.  In command mode, the top line of
                    168: the terminal screen becomes the command prompt window, and
                    169: .Nm window
                    170: interprets input from the keyboard as commands to manipulate windows.
                    171: .Pp
                    172: There are two types of commands: short commands are usually one or two
                    173: key strokes; long commands are strings either typed by the user in the
                    174: command window (see the
                    175: .Dq Ic \&:
                    176: command below), or read from a file (see
                    177: .Ic source
                    178: below).
                    179: .Ss Short Commands
                    180: Below,
                    181: .Ar #
                    182: represents one of the digits ``1'' to ``9''
                    183: corresponding to the windows 1 to 9.
                    184: .Ic ^X
                    185: means
                    186: .Cx control\-
                    187: .Ar X  ,
                    188: .Cx
                    189: where
                    190: .Ar X
                    191: is any character.  In particular,
                    192: .Ic ^^
                    193: is
                    194: .Li control\-^.
                    195: .Ar Escape
                    196: is the escape key, or
                    197: .Ic ^\&[
                    198: .Tw Ds
                    199: .Tp Ar #
                    200: Select window
                    201: .Ar #
                    202: as the current window
                    203: and return to conversation mode.
                    204: .Tp Cx Ic %
                    205: .Ar #
                    206: .Cx
                    207: Select window
                    208: .Ar #
                    209: but stay in command mode.
                    210: .Tp Ic ^^
                    211: Select the previous window and return to conversation
                    212: mode.  This is useful for toggling between two windows.
                    213: .Tp Ic escape
                    214: Return to conversation mode.
                    215: .Tp Ic ^P
                    216: Return to conversation mode and write
                    217: .Ic ^P
                    218: to the
                    219: current window.  Thus, typing two
                    220: .Cx Ic ^P
                    221: .Cx \'s
                    222: .Cx
                    223: in conversation
                    224: mode sends one to the current window.  If the
                    225: .Nm window
                    226: escape is changed to some other character, that
                    227: character takes the place of
                    228: .Ic ^P
                    229: here.
                    230: .Tp Ic ?
                    231: List a short summary of commands.
                    232: .Tp Ic ^L
                    233: Refresh the screen.
                    234: .Tp Ic q
                    235: Exit
                    236: .Nm window  .
                    237: Confirmation is requested.
                    238: .Tp Ic ^Z
                    239: Suspend
                    240: .Nm window  .
                    241: .Tp Ic w
                    242: Create a new window.  The user is prompted for the positions
                    243: of the upper left and lower right corners of the window.
                    244: The cursor is placed on the screen and the keys ``h'', ``j'',
                    245: ``k'', and ``l''
                    246: move the cursor left, down, up, and right, respectively.
                    247: The keys ``H'', ``J'', ``K'', and ``L'' move the cursor to the respective
                    248: limits of the screen.  Typing a number before the movement keys
                    249: repeats the movement that number of times.  Return enters the cursor position
                    250: as the upper left corner of the window.  The lower right corner
                    251: is entered in the same manner.  During this process,
                    252: the placement of the new window is indicated by a rectangular
                    253: box drawn on the screen, corresponding to where the new window
                    254: will be framed.  Typing escape at any point
                    255: cancels this command.
                    256: .Pp
                    257: This window becomes the current window,
                    258: and is given the first available ID.  The default buffer size
                    259: is used (see
                    260: .Ar default_nline
                    261: command below).
                    262: .Pp
                    263: Only fully visible windows can be created this way.
                    264: .Tp Cx Ic c
                    265: .Ar #
                    266: .Cx
                    267: Close window
                    268: .Ar # .
                    269: The process in the window is sent
                    270: the hangup signal (see
                    271: .Xr kill 1 ) .
                    272: .Xr Csh 1
                    273: should
                    274: handle this signal correctly and cause no problems.
                    275: .Tp Cx Ic m
                    276: .Ar #
                    277: .Cx
                    278: Move window
                    279: .Ar #
                    280: to another location.  A box in the shape
                    281: of the window is drawn on
                    282: the screen to indicate the new position of the window, and the same keys as
                    283: those for the
                    284: .Ic w
                    285: command are used to position the box.  The
                    286: window can be moved partially off-screen.
                    287: .Tp Cx Ic M
                    288: .Ar #
                    289: .Cx
                    290: Move window
                    291: .Ar #
                    292: to its previous position.
                    293: .Tp Cx Ic s
                    294: .Ar #
                    295: .Cx
                    296: Change the size of window
                    297: .Ar # .
                    298: The user is prompted
                    299: to enter the new lower right corner of the window.  A box
                    300: is drawn to indicate the new window size.  The same
                    301: keys used in
                    302: .Ic w
                    303: and
                    304: .Ic m
                    305: are used to enter the position.
                    306: .Tp Cx Ic S
                    307: .Ar #
                    308: .Cx
                    309: Change window
                    310: .Ar #
                    311: to its previous size.
                    312: .Tp Ic ^Y
                    313: Scroll the current window up by one line.
                    314: .Tp Ic ^E
                    315: Scroll the current window down by one line.
                    316: .Tp Ic ^U
                    317: Scroll the current window up by half the window size.
                    318: .Tp Ic ^D
                    319: Scroll the current window down by half the window size.
                    320: .Tp Ic ^B
                    321: Scroll the current window up by the full window size.
                    322: .Tp Ic ^F
                    323: Scroll the current window down by the full window size.
                    324: .Tp Ic h
                    325: Move the cursor of the current window left by one column.
                    326: .Tp Ic j
                    327: Move the cursor of the current window down by one line.
                    328: .Tp Ic k
                    329: Move the cursor of the current window up by one line.
                    330: .Tp Ic l
                    331: Move the cursor of the current window right by one column.
                    332: .Tp Ic ^S
                    333: Stop output in the current window.
                    334: .Tp Ic ^Q
                    335: Start output in the current window.
                    336: .Tp Ic :
                    337: Enter a line to be executed as long commands.
                    338: Normal line
                    339: editing characters (erase character, erase word, erase line)
                    340: are supported.
                    341: .Tp
                    342: .Ss Long Commands
                    343: Long commands are a sequence of statements
                    344: parsed much like a programming language, with a syntax
                    345: similar to that of C.  Numeric and string expressions and variables
                    346: are supported, as well as conditional statements.
                    347: .Pp
                    348: There are two data types: string and number.  A string is a sequence
                    349: of letters or digits beginning with a letter.  ``_'' and ``.'' are
                    350: considered letters.  Alternately, non-alphanumeric characters can
                    351: be included in strings by quoting them in ``"'' or escaping them
                    352: with ``\\''.  In addition, the ``\\'' sequences of C are supported,
                    353: both inside and outside quotes (e.g., ``\\n'' is a new line,
                    354: ``\\r'' a carriage return).  For example, these are legal strings:
                    355: abcde01234, "&#$^*&#", ab"$#"cd, ab\\$\\#cd, "/usr/ucb/window".
                    356: .Pp
                    357: A number is an integer value in one of three forms:
                    358: a decimal number, an octal number preceded by ``0'',
                    359: or a hexadecimal number preceded by ``0x'' or ``0X''.  The natural
                    360: machine integer size is used (i.e., the signed integer type
                    361: of the C compiler).  As in C, a non-zero number represents
                    362: a boolean true.
                    363: .Pp
                    364: The character ``#'' begins a comment which terminates at the
                    365: end of the line.
                    366: .Pp
                    367: A statement is either a conditional or an expression.  Expression
                    368: statements are terminated with a new line or ``;''.  To continue
                    369: an expression on the next line, terminate the first line with ``\\''.
                    370: .Ss Conditional Statement
                    371: .Nm Window
                    372: has a single control structure:
                    373: the fully bracketed if statement in the form
                    374: .Pp
                    375: .Ds I
                    376: if <expr> then
                    377: \t<statement>
                    378: \t...
                    379: elsif <expr> then
                    380: \t<statement>
                    381: \t...
                    382: else
                    383: \t<statement>
                    384: \t...
                    385: endif
                    386: .De
                    387: .Pp
                    388: The
                    389: .Ic else
                    390: and
                    391: .Ic elsif
                    392: parts are optional, and the latter can
                    393: be repeated any number of times.
                    394: <Expr>
                    395: must be numeric.
                    396: .Ss Expressions
                    397: Expressions in
                    398: .Nm window
                    399: are similar to those in the
                    400: C language, with most C operators supported on numeric
                    401: operands.  In addition, some are overloaded to operate on strings.
                    402: .Pp
                    403: When an expression is used as a statement, its value is discarded
                    404: after evaluation.  Therefore, only expressions with side
                    405: effects (assignments and function calls) are useful as statements.
                    406: .Pp
                    407: Single valued (no arrays) variables are supported, of both
                    408: numeric and string values.  Some variables are predefined.  They
                    409: are listed below.
                    410: .Pp
                    411: The operators in order of increasing precedence:
                    412: .Tw Fl
                    413: .Tp Cx <
                    414: .Va expr1
                    415: .Cx >
                    416: .Cx \&\ \&
                    417: .Ic =
                    418: .Cx \&\ \&
                    419: .Cx <
                    420: .Va expr2
                    421: .Cx >
                    422: .Cx
                    423: Assignment.  The variable of name
                    424: .Cx <
                    425: .Va expr1
                    426: .Cx >,
                    427: .Cx
                    428: which must be string valued,
                    429: is assigned the result of
                    430: .Cx <
                    431: .Va expr2
                    432: .Cx >.
                    433: .Cx
                    434: Returns the value of
                    435: .Cx <
                    436: .Va expr2
                    437: .Cx >.
                    438: .Cx
                    439: .Tp Cx <
                    440: .Va expr1
                    441: .Cx >
                    442: .Cx \&\ \&
                    443: .Ic ?
                    444: .Cx \&\ \&
                    445: .Cx <
                    446: .Va expr2
                    447: .Cx >
                    448: .Cx \&\ \&
                    449: .Ic :
                    450: .Cx \&\ \&
                    451: .Cx <
                    452: .Va expr3
                    453: .Cx >
                    454: .Cx
                    455: Returns the value of
                    456: .Cx <
                    457: .Va expr2
                    458: .Cx >
                    459: .Cx
                    460: if
                    461: .Cx <
                    462: .Va expr1
                    463: .Cx >
                    464: .Cx
                    465: evaluates true
                    466: (non-zero numeric value); returns the value of
                    467: .Cx <
                    468: .Va expr3
                    469: .Cx >
                    470: .Cx
                    471: otherwise.  Only
                    472: one of
                    473: .Cx <
                    474: .Va expr2
                    475: .Cx >
                    476: .Cx
                    477: and
                    478: .Cx <
                    479: .Va expr3
                    480: .Cx >
                    481: .Cx
                    482: is evaluated.
                    483: .Cx <
                    484: .Va Expr1
                    485: .Cx >
                    486: .Cx
                    487: must
                    488: be numeric.
                    489: .Tp Cx <
                    490: .Va expr1
                    491: .Cx >
                    492: .Cx \&\ \&
                    493: .Ic \&|\&|
                    494: .Cx \&\ \&
                    495: .Cx <
                    496: .Va expr2
                    497: .Cx >
                    498: .Cx
                    499: Logical or.  Numeric values only.  Short circuit evaluation is supported
                    500: (i.e., if
                    501: .Cx <
                    502: .Va expr1
                    503: .Cx >
                    504: .Cx
                    505: evaluates true, then
                    506: .Cx <
                    507: .Va expr2
                    508: .Cx >
                    509: .Cx
                    510: is not evaluated).
                    511: .Tp Cx <
                    512: .Va expr1
                    513: .Cx >
                    514: .Cx \&\ \&
                    515: .Ic \&&\&&
                    516: .Cx \&\ \&
                    517: .Cx <
                    518: .Va expr2
                    519: .Cx >
                    520: .Cx
                    521: Logical and with short circuit evaluation.  Numeric values only.
                    522: .Tp Cx <
                    523: .Va expr1
                    524: .Cx >
                    525: .Cx \&\ \&
                    526: .Ic \&|
                    527: .Cx \&\ \&
                    528: .Cx <
                    529: .Va expr2
                    530: .Cx >
                    531: .Cx
                    532: Bitwise or.  Numeric values only.
                    533: .Tp Cx <
                    534: .Va expr1
                    535: .Cx >
                    536: .Cx \&\ \&
                    537: .Ic ^
                    538: .Cx \&\ \&
                    539: .Cx <
                    540: .Va expr2
                    541: .Cx >
                    542: .Cx
                    543: Bitwise exclusive or.  Numeric values only.
                    544: .Tp Cx <
                    545: .Va expr1
                    546: .Cx >
                    547: .Cx \&\ \&
                    548: .Ic \&&
                    549: .Cx \&\ \&
                    550: .Cx <
                    551: .Va expr2
                    552: .Cx >
                    553: .Cx
                    554: Bitwise and.  Numeric values only.
                    555: .Tp Cx <
                    556: .Va expr1
                    557: .Cx >
                    558: .Cx \&\ \&
                    559: .Ic =
                    560: .Cx \&\ \&
                    561: .Cx <
                    562: .Va expr2
                    563: .Cx >,
                    564: .Cx \&\ \&
                    565: .Va expr1
                    566: .Cx >
                    567: .Cx \&\ \&
                    568: .Ic !=
                    569: .Cx \&\ \&
                    570: .Cx <
                    571: .Va expr2
                    572: .Cx >
                    573: .Cx
                    574: Comparison (equal and not equal, respectively).  The boolean
                    575: result (either 1 or 0) of the comparison is returned.  The
                    576: operands can be numeric or string valued.  One string operand
                    577: forces the other to be converted to a string in necessary.
                    578: .Tp Cx <
                    579: .Va expr1
                    580: .Cx >
                    581: .Cx \&\ \&
                    582: .Ic <
                    583: .Cx \&\ \&
                    584: .Cx <
                    585: .Va expr2
                    586: .Cx >,
                    587: .Cx \&\ \&
                    588: .Va expr1
                    589: .Cx >
                    590: .Cx \&\ \&
                    591: .Ic >
                    592: .Cx \&\ \&
                    593: .Cx <
                    594: .Va expr2
                    595: .Cx >,
                    596: .Cx \&\ \&
                    597: .Va expr1
                    598: .Cx >
                    599: .Cx \&\ \&
                    600: .Ic <=
                    601: .Cx \&\ \&
                    602: .Cx <
                    603: .Va expr2
                    604: .Cx >,
                    605: .Cx
                    606: Less than, greater than, less than or equal to,
                    607: greater than or equal to.  Both numeric and string values, with
                    608: automatic conversion as above.
                    609: .Tp Cx <
                    610: .Va expr1
                    611: .Cx >
                    612: .Cx \&\ \&
                    613: .Ic <<
                    614: .Cx \&\ \&
                    615: .Cx <
                    616: .Va expr2
                    617: .Cx >,
                    618: .Cx \&\ \&
                    619: .Va expr1
                    620: .Cx >
                    621: .Cx \&\ \&
                    622: .Ic >>
                    623: .Cx \&\ \&
                    624: .Cx <
                    625: .Va expr2
                    626: .Cx >
                    627: .Cx
                    628: If both operands are numbers,
                    629: .Cx <
                    630: .Va expr1
                    631: .Cx >
                    632: .Cx
                    633: is bit
                    634: shifted left (or right) by
                    635: .Cx <
                    636: .Va expr2
                    637: .Cx >
                    638: .Cx
                    639: bits.  If
                    640: .Cx <
                    641: .Va expr1
                    642: .Cx >
                    643: .Cx
                    644: is
                    645: a string, then its first (or last)
                    646: .Cx <
                    647: .Va expr2
                    648: .Cx >
                    649: .Cx
                    650: characters are
                    651: returns (if
                    652: .Cx <
                    653: .Va expr2
                    654: .Cx >
                    655: .Cx
                    656: is also a string, then its length is used
                    657: in place of its value).
                    658: .Tp Cx <
                    659: .Va expr1
                    660: .Cx >
                    661: .Cx \&\ \&
                    662: .Ic +
                    663: .Cx \&\ \&
                    664: .Cx <
                    665: .Va expr2
                    666: .Cx >,
                    667: .Cx \&\ \&
                    668: .Va expr1
                    669: .Cx >
                    670: .Cx \&\ \&
                    671: .Ic -
                    672: .Cx \&\ \&
                    673: .Cx <
                    674: .Va expr2
                    675: .Cx >
                    676: .Cx
                    677: Addition and subtraction on numbers.  For ``+'', if one
                    678: argument is a string, then the other is converted to a string,
                    679: and the result is the concatenation of the two strings.
                    680: .Tp Cx <
                    681: .Va expr1
                    682: .Cx >
                    683: .Cx \&\ \&
                    684: .Ic \&*
                    685: .Cx \&\ \&<
                    686: .Va expr2
                    687: .Cx >,
                    688: .Cx \&\ \&<
                    689: .Va expr1
                    690: .Cx >
                    691: .Cx \&\ \&
                    692: .Ic \&/
                    693: .Cx \&\ \&<
                    694: .Va expr2
                    695: .Cx >,\&\ \&<
                    696: .Va expr1
                    697: .Cx >,
                    698: .Cx \&\ \&<
                    699: .Va expr1
                    700: .Cx >
                    701: .Cx \&\ \&
                    702: .Ic \&%
                    703: .Cx \&\ \&<
                    704: .Va expr2
                    705: .Cx >
                    706: .Cx
                    707: Multiplication, division, modulo.  Numbers only.
                    708: .Tp Cx <
                    709: .Va expr
                    710: .Cx >,
                    711: .Cx \&\ \&
                    712: .Ic ~
                    713: .Cx <
                    714: .Va expr
                    715: .Cx >,
                    716: .Cx \&\ \&
                    717: .Ic \&!
                    718: .Cx <
                    719: .Va expr
                    720: .Cx >,
                    721: .Cx \&\ \&
                    722: .Ic \&$
                    723: .Cx <
                    724: .Va expr
                    725: .Cx >,
                    726: .Cx \&\ \&
                    727: .Ic \&$?
                    728: .Cx <
                    729: .Va expr
                    730: .Cx >
                    731: .Cx
                    732: The first three are unary minus, bitwise complement and logical complement
                    733: on numbers only.  The operator, ``$'', takes
                    734: .Cx <
                    735: .Va expr
                    736: .Cx >
                    737: .Cx
                    738: and returns
                    739: the value of the variable of that name.  If
                    740: .Cx <
                    741: .Va expr
                    742: .Cx >
                    743: .Cx
                    744: is numeric
                    745: with value
                    746: .Ar n
                    747: and it appears within an alias macro (see below),
                    748: then it refers to the nth argument of the alias invocation.  ``$?''
                    749: tests for the existence of the variable
                    750: .Cx <
                    751: .Va expr
                    752: .Cx >,
                    753: .Cx
                    754: and returns 1
                    755: if it exists or 0 otherwise.
                    756: .Tp Cx <
                    757: .Va expr
                    758: .Cx >(<
                    759: .Ar arglist
                    760: .Cx >)
                    761: .Cx
                    762: Function call.
                    763: .Cx <
                    764: .Va Expr
                    765: .Cx >
                    766: .Cx
                    767: must be a string that is the unique
                    768: prefix of the name of a builtin
                    769: .Nm window
                    770: function
                    771: or the full name of a user defined alias macro.  In the case of a builtin
                    772: function,
                    773: .Cx <
                    774: .Ar arglist
                    775: .Cx >
                    776: .Cx
                    777: can be in one of two forms:
                    778: .Dl <expr1>, <expr2>, ...
                    779: .Dl argname1 = <expr1>, argname2 = <expr2>, ...
                    780: The two forms can in fact be intermixed, but the result is
                    781: unpredictable.  Most arguments can be omitted; default values will
                    782: be supplied for them.  The
                    783: .Ar argnames
                    784: can be unique prefixes
                    785: of the the argument names.  The commas separating
                    786: arguments are used only to disambiguate, and can usually be omitted.
                    787: .Pp
                    788: Only the first argument form is valid for user defined aliases.  Aliases
                    789: are defined using the
                    790: .Ic alias
                    791: builtin function (see below).  Arguments
                    792: are accessed via a variant of the variable mechanism (see ``$'' operator
                    793: above).
                    794: .Pp
                    795: Most functions return value, but some are used for side effect
                    796: only and so must be used as statements.  When a function or an alias is used
                    797: as a statement, the parenthesis surrounding
                    798: the argument list may be omitted.  Aliases return no value.
                    799: .Tp
                    800: .Ss  Builtin Functions
                    801: The arguments are listed by name in their natural
                    802: order.  Optional arguments are in square brackets
                    803: .Sq Op .
                    804: Arguments
                    805: that have no names are in angle brackets
                    806: .Sq <> .
                    807: An argument meant to be a boolean flag (often named
                    808: .Ar flag )
                    809: can be one of
                    810: .Ar on ,
                    811: .Ar off ,
                    812: .Ar yes ,
                    813: .Ar no ,
                    814: .Ar true ,
                    815: or
                    816: .Ar false ,
                    817: with
                    818: obvious meanings, or it can be a numeric expression,
                    819: in which case a non-zero value is true.
                    820: .Tw Fl
                    821: .Tp Cx Ic alias
                    822: .Cx \&([<
                    823: .Ar string
                    824: .Cx ]>,
                    825: .Cx \&\ \&[<
                    826: .Ar  string\-list
                    827: .Cx >]\&)
                    828: .Cx
                    829: If no argument is given, all currently defined alias macros are
                    830: listed.  Otherwise,
                    831: .Cx <
                    832: .Ar string
                    833: .Cx >
                    834: .Cx
                    835: is defined as an alias,
                    836: with expansion
                    837: .Cx <
                    838: .Ar string\-list
                    839: .Cx > .
                    840: .Cx
                    841: The previous definition of
                    842: .Cx <
                    843: .Ar string
                    844: .Cx >,
                    845: .Cx
                    846: if any, is returned.  Default for
                    847: .Cx <
                    848: .Ar string\-list
                    849: .Cx >
                    850: .Cx
                    851: is no change.
                    852: .Tp Cx Ic close
                    853: .Cx (<
                    854: .Ar window\-list
                    855: .Cx >)
                    856: .Cx
                    857: Close the windows specified in
                    858: .Cx <
                    859: .Ar window\-list
                    860: .Cx >.
                    861: .Cx
                    862: If
                    863: .Cx <
                    864: .Ar window\-list
                    865: .Cx >
                    866: .Cx
                    867: is the word
                    868: .Ar all  ,
                    869: than all windows are closed.  No value is returned.
                    870: .Tp Cx Ic cursormodes
                    871: .Cx \&(
                    872: .Op Ar modes
                    873: .Cx \&)
                    874: .Cx
                    875: Set the window cursor to
                    876: .Ar modes  .
                    877: .Ar Modes
                    878: is the bitwise
                    879: or of the mode bits defined as the variables
                    880: .Ar m_ul
                    881: (underline),
                    882: .Ar m_rev
                    883: (reverse video),
                    884: .Ar m_blk
                    885: (blinking),
                    886: and
                    887: .Ar m_grp
                    888: (graphics, terminal dependent).  Return
                    889: value is the previous modes.  Default is no change.
                    890: For example,
                    891: .Li cursor($m_rev$m_blk)
                    892: sets the window cursors to blinking
                    893: reverse video.
                    894: .Tp Cx Ic default_nline
                    895: .Cx \&(
                    896: .Op Ar nline
                    897: .Cx \&)
                    898: .Cx
                    899: Set the default buffer size to
                    900: .Ar nline  .
                    901: Initially, it is
                    902: 48 lines.  Returns the old default buffer size.  Default is
                    903: no change.  Using a very large buffer can slow the program down
                    904: considerably.
                    905: .Tp Cx Ic default_shell
                    906: .Cx \&([<
                    907: .Ar string\-list
                    908: .Cx >]\&)
                    909: .Cx
                    910: Set the default window shell program to
                    911: .Cx <
                    912: .Ar string\-list
                    913: .Cx >.
                    914: .Cx
                    915: Returns
                    916: the first string in the old shell setting.  Default is no change.  Initially,
                    917: the default shell is taken from the environment variable
                    918: .Ev SHELL  .
                    919: .Tp Cx Ic default_smooth
                    920: .Cx \&(
                    921: .Op Ar flag
                    922: .Cx \&)
                    923: .Cx
                    924: Set the default value of the
                    925: .Ar smooth
                    926: argument
                    927: to the command
                    928: .Nm window
                    929: (see below).  The argument
                    930: is a boolean flag (one of
                    931: .Ar on  ,
                    932: .Ar off  ,
                    933: .Ar yes  ,
                    934: .Ar no  ,
                    935: .Ar true  ,
                    936: .Ar false  ,
                    937: or a number,
                    938: as described above).  Default is no change.
                    939: The old value (as a number) is returned.
                    940: The initial value is 1 (true).
                    941: .Tp Cx Ic echo
                    942: .Cx \&(
                    943: .Op Ar window
                    944: .Cx \&,\&\ \&[<
                    945: .Ar string\-list
                    946: .Cx >]\&)
                    947: .Cx
                    948: Write the list of strings,
                    949: .Cx <
                    950: .Ar string-list
                    951: .Cx >,
                    952: .Cx
                    953: to
                    954: .Nm window  ,
                    955: separated
                    956: by spaces and terminated with a new line.  The strings are only
                    957: displayed in the window, the processes in the window are not
                    958: involved (see
                    959: .Ic write
                    960: below).  No value is returned.  Default
                    961: is the current window.
                    962: .Tp Cx Ic escape
                    963: .Cx \&(
                    964: .Op Ar escapec
                    965: .Cx \&)
                    966: .Cx
                    967: Set the escape character to
                    968: .Ar escape-char  .
                    969: Returns the old
                    970: escape character as a one-character string.  Default is no
                    971: change.
                    972: .Ar Escapec
                    973: can be a string of a single character, or
                    974: in the form
                    975: .Fl ^X ,
                    976: meaning
                    977: Cx control\-
                    978: .Ar X
                    979: .Cx .
                    980: .Cx
                    981: .Tp Cx Ic foreground
                    982: .Cx \&(
                    983: .Op Ar window
                    984: .Cx \&,
                    985: .Op Ar flag
                    986: .Cx \&)
                    987: .Cx
                    988: Move
                    989: .Nm window
                    990: in or out of foreground.
                    991: .Ar Flag
                    992: is a boolean value.  The old foreground flag
                    993: is returned.  Default for
                    994: .Nm window
                    995: is the current window,
                    996: default for
                    997: .Ar flag
                    998: is no change.
                    999: .Tp Cx Ic label
                   1000: .Cx \&(
                   1001: .Op Ar window
                   1002: .Cx \&,
                   1003: .Op Ar label
                   1004: .Cx \&)
                   1005: .Cx
                   1006: Set the label of
                   1007: .Nm window
                   1008: to
                   1009: .Ar label  .
                   1010: Returns the old
                   1011: label as a string.  Default for
                   1012: .Nm window
                   1013: is the current
                   1014: window, default for
                   1015: .Ar label
                   1016: is no change.  To turn
                   1017: off a label, set it to an empty string ("").
                   1018: .Tp Cx Ic list
                   1019: .Cx \&( \&)
                   1020: .Cx
                   1021: No arguments.  List the identifiers and labels of all windows.  No
                   1022: value is returned.
                   1023: .Tp Cx Ic select
                   1024: .Cx \&(
                   1025: .Op Ar window
                   1026: .Cx \&)
                   1027: .Cx
                   1028: Make
                   1029: .Nm window
                   1030: the current window.  The previous current window
                   1031: is returned.  Default is no change.
                   1032: .Tp Cx Ic source
                   1033: .Cx \&(
                   1034: .Ar filename
                   1035: .Cx \&)
                   1036: .Cx
                   1037: Read and execute the long commands in
                   1038: .Ar filename  .
                   1039: Returns -1 if the file cannot be read, 0 otherwise.
                   1040: .Tp Cx Ic terse
                   1041: .Cx \&(
                   1042: .Op flag
                   1043: .Cx \&)
                   1044: .Cx
                   1045: Set terse mode to
                   1046: .Ar flag  .
                   1047: In terse mode, the command window
                   1048: stays hidden even in command mode, and errors are reported by
                   1049: sounding the terminal's bell.
                   1050: .Ar Flag
                   1051: can take on the same
                   1052: values as in
                   1053: .Ar foreground
                   1054: above.  Returns the old terse flag.
                   1055: Default is no change.
                   1056: .Tp Cx Ic unalias
                   1057: .Cx \&(
                   1058: .Ar alias
                   1059: .Cx \&)
                   1060: .Cx
                   1061: Undefine
                   1062: .Ar alias  .
                   1063: Returns -1 if
                   1064: .Ar alias
                   1065: does not exist,
                   1066: 0 otherwise.
                   1067: .Tp Cx Ic unset
                   1068: .Cx \&(
                   1069: .Ar variable
                   1070: .Cx \&)
                   1071: .Cx
                   1072: Undefine
                   1073: .Ar variable  .
                   1074: Returns -1 if
                   1075: .Ar variable
                   1076: does not exist,
                   1077: 0 otherwise.
                   1078: .Tp Cx Ic variables
                   1079: .Cx \&( \&)
                   1080: .Cx
                   1081: No arguments.  List all variables.  No value is returned.
                   1082: .Tp Cx Ic window
                   1083: .Cx \&(
                   1084: .Op Ar row
                   1085: .Cx \&,
                   1086: .Cx \&\ \&
                   1087: .Op Ar column
                   1088: .Cx \&,
                   1089: .Cx \&\ \&
                   1090: .Op Ar nrow
                   1091: .Cx \&,
                   1092: .Cx \&\ \&
                   1093: .Op Ar ncol
                   1094: .Cx \&,
                   1095: .Cx \&\ \&
                   1096: .Op Ar nline
                   1097: .Cx \&,
                   1098: .Cx \&\ \&
                   1099: .Op Ar label
                   1100: .Cx \&,
                   1101: .Cx \&\ \&
                   1102: .Cx Op Ar pty
                   1103: .Cx \&,
                   1104: .Cx
                   1105: .Op Ar frame
                   1106: .Cx \&,
                   1107: .Cx \&\ \&
                   1108: .Op Ar mapnl
                   1109: .Cx \&,
                   1110: .Cx \&\ \&
                   1111: .Op Ar keepopen
                   1112: .Cx \&,
                   1113: .Cx \&\ \&
                   1114: .Op Ar smooth
                   1115: .Cx \&,
                   1116: .Cx \&\ \&
                   1117: .Op Ar shell
                   1118: .Cx \&).
                   1119: .Cx
                   1120: Open a window with upper left corner at
                   1121: .Ar row  ,
                   1122: .Ar column
                   1123: and size
                   1124: .Ar nrow  ,
                   1125: .Ar ncol  .
                   1126: If
                   1127: .Ar nline
                   1128: is specified,
                   1129: then that many lines are allocated for the text buffer.  Otherwise,
                   1130: the default buffer size is used.  Default values for
                   1131: .Ar row  ,
                   1132: .Ar column  ,
                   1133: .Ar nrow  ,
                   1134: and
                   1135: .Ar ncol
                   1136: are, respectively,
                   1137: the upper, left-most, lower, or right-most extremes of the
                   1138: screen.
                   1139: .Ar Label
                   1140: is the label string.
                   1141: .Ar Frame  ,
                   1142: .Ar pty  ,
                   1143: and
                   1144: .Ar mapnl
                   1145: are flag values
                   1146: interpreted in the same way as the argument to
                   1147: .Ar foreground
                   1148: (see above);
                   1149: they mean, respectively, put a frame around this window (default true),
                   1150: allocate pseudo-terminal for this window rather than socketpair (default
                   1151: true), and map new line characters in this window to carriage return
                   1152: and line feed (default true if socketpair is used, false otherwise).
                   1153: Normally, a window is automatically closed when its process
                   1154: exits.  Setting
                   1155: .Ar keepopen
                   1156: to true (default false) prevents this
                   1157: action.  When
                   1158: .Ar smooth
                   1159: is true, the screen is updated more frequently
                   1160: (for this window) to produce a more terminal-like behavior.
                   1161: The default value of
                   1162: .Ar smooth
                   1163: is set by the
                   1164: .Ar default_smooth
                   1165: command (see above).
                   1166: .Ar Shell
                   1167: is a list of strings that will be used as the shell
                   1168: program to place in the window (default is the program specified
                   1169: by
                   1170: .Ar default_shell  ,
                   1171: see above).  The created window's identifier
                   1172: is returned as a number.
                   1173: .Tp Cx Ic write
                   1174: .Cx \&(
                   1175: .Op Ar window
                   1176: .Cx \&,\&\ \&[<
                   1177: .Ar string\-list
                   1178: .Cx >]\&)
                   1179: .Cx
                   1180: Send the list of strings,
                   1181: .Cx <
                   1182: .Ar string-list
                   1183: .Cx >,
                   1184: .Cx
                   1185: to
                   1186: .Nm window  ,
                   1187: separated
                   1188: by spaces but not terminated with a new line.  The strings are actually
                   1189: given to the window as input.  No value is returned.  Default
                   1190: is the current window.
                   1191: .Tp
                   1192: .Ss Predefined Variables
                   1193: These variables are for information only.  Redefining them does
                   1194: not affect the internal operation of
                   1195: .Nm window  .
                   1196: .Tw Fl
                   1197: .Tp Ar baud
                   1198: The baud rate as a number between 50 and 38400.
                   1199: .Tp Ar modes
                   1200: The display modes (reverse video, underline, blinking, graphics)
                   1201: supported by the physical terminal.  The value of
                   1202: .Ar modes
                   1203: is the bitwise or of some of the one bit values,
                   1204: .Ar m_blk ,
                   1205: .Ar m_grp ,
                   1206: .Ar m_rev ,
                   1207: and
                   1208: .Ar m_ul
                   1209: (see below).
                   1210: These values are useful
                   1211: in setting the window cursors' modes (see
                   1212: .Ar cursormodes
                   1213: above).
                   1214: .Tp Ar m_blk
                   1215: The blinking mode bit.
                   1216: .Tp Ar m_grp
                   1217: The graphics mode bit (not very useful).
                   1218: .Tp Ar m_rev
                   1219: The reverse video mode bit.
                   1220: .Tp Ar m_ul
                   1221: The underline mode bit.
                   1222: .Tp Ar ncol
                   1223: The number of columns on the physical screen.
                   1224: .Tp Ar nrow
                   1225: The number of rows on the physical screen.
                   1226: .Tp Ar term
                   1227: The terminal type.  The standard name, found in the second name
                   1228: field of the terminal's
                   1229: .Ev TERMCAP
                   1230: entry, is used.
                   1231: .Sh ENVIRONMENT
                   1232: .Nm Window
                   1233: utilizes these environment variables:
                   1234: .Ev HOME ,
                   1235: .Ev SHELL ,
                   1236: .Ev TERM ,
                   1237: .Ev TERMCAP ,
                   1238: .Ev WINDOW_ID .
                   1239: .Sh FILES
                   1240: .Dw /dev/[pt]ty[pq]?
                   1241: .Di L
                   1242: .Dp Pa ~/.windowrc
                   1243: startup command file.
                   1244: .Dp Cx Pa /dev/
                   1245: .Op Pa pt
                   1246: .Cx ty
                   1247: .Op Pa pq
                   1248: .Cx ?
                   1249: .Cx
                   1250: pseudo-terminal devices.
                   1251: .Dp
                   1252: .Sh HISTORY
                   1253: .Nm window
                   1254: appeared in 4.3 BSD.
                   1255: .Sh DIAGNOSTICS
                   1256: Should be self explanatory.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.