| 1 | .\" @(#)window.1 3.8 %G% |
| 2 | |
| 3 | .\" Copyright (c) 1983 Regents of the University of California, |
| 4 | .\" All rights reserved. Redistribution permitted subject to |
| 5 | .\" the terms of the Berkeley Software License Agreement. |
| 6 | |
| 7 | .TH WINDOW 1 "2 April 1985" |
| 8 | .SH NAME |
| 9 | window \- window environment |
| 10 | .SH SYNOPSIS |
| 11 | .B window |
| 12 | [ |
| 13 | .B \-t |
| 14 | ] [ |
| 15 | .B \-f |
| 16 | ] [ |
| 17 | .B \-d |
| 18 | ] [ |
| 19 | .B \-e escape-char |
| 20 | ] [ |
| 21 | .B \-c command |
| 22 | ] |
| 23 | .SH DESCRIPTION |
| 24 | \fIWindow\fP provides a window oriented environment |
| 25 | on ordinary CRT terminals. |
| 26 | .PP |
| 27 | A window is a rectangular portion of the physical terminal |
| 28 | screen associated with a set of processes. These processes |
| 29 | communicate with the window in the same way they normally |
| 30 | interact with a terminal. The window program handles the |
| 31 | details of redirecting input an output to and from the |
| 32 | windows. At any one time, only one window can receive |
| 33 | input from the keyboard, but all windows can simultaneously send output |
| 34 | to the display. |
| 35 | .PP |
| 36 | Windows can overlap and are framed as necessary. Each window |
| 37 | is named by one of the digits ``1'' to ``9''. This one character |
| 38 | identifier, as well as a user definable label string, are displayed |
| 39 | with the window on the top edge of its frame. A window can be |
| 40 | designated to be in the \fIforeground\fP, in which case it will always be |
| 41 | on top of all normal, non-foreground windows, and can be covered |
| 42 | only by other foreground windows. |
| 43 | .PP |
| 44 | A window need not be completely within the edges of the terminal screen. |
| 45 | Thus a large window (possibly larger than the screen) |
| 46 | can be positioned to show only a portion of its full size. In addition, |
| 47 | both the size and the position of a window can be changed by |
| 48 | the user at any time. |
| 49 | .PP |
| 50 | Windows are designed to have the appearance of real terminals |
| 51 | both to the user and to the processes running in them. Each window |
| 52 | has a cursor and a set of control functions. Most intelligent |
| 53 | terminal functions such as line and |
| 54 | character deletion and insertion are supported. Display modes |
| 55 | such as underlining and reverse video are available if the terminal |
| 56 | allows them. Also, similar to terminals with multiple pages of memory, |
| 57 | each window has a text buffer which can be larger than the window. |
| 58 | Different parts of the buffer can be displayed by scrolling. |
| 59 | .SH OPTIONS |
| 60 | When \fIwindow\fP starts up, the file \fI.windowrc\fP in the |
| 61 | user's home directory is checked. If it exists, then the |
| 62 | commands contained in it are executed (see \fIsource\fP command below). |
| 63 | Otherwise, two equal sized windows are created by default. |
| 64 | .PP |
| 65 | The command line arguments are |
| 66 | .TP |
| 67 | .B \-t |
| 68 | Turn on terse mode (see \fIterse\fP command below). |
| 69 | .TP |
| 70 | .B \-f |
| 71 | Don't perform any startup action. |
| 72 | .TP |
| 73 | .B \-d |
| 74 | Ignore \fI.windowrc\fP and create the two default |
| 75 | windows instead. |
| 76 | .TP |
| 77 | .B \-e escape-char |
| 78 | Set the escape character to \fIescape-char\fP. \fIEscape-char\fP |
| 79 | can be a single character, or in the form \fI^X\fP where \fIX\fP |
| 80 | is any character, meaning control-\fIX\fP. |
| 81 | .TP |
| 82 | .B \-c command |
| 83 | Execute the string \fIcommand\fP as a long command (see below) |
| 84 | before doing anything else. |
| 85 | .SH "PROCESS ENVIRONMENT" |
| 86 | With each newly created window, a shell program is spawned with its |
| 87 | process environment tailored to that window. Its standard input, |
| 88 | output, and diagnostic file descriptors are bound to one end of either |
| 89 | a pseudo-terminal (\fIpty\fP (4)) or a UNIX domain socket |
| 90 | (\fIsocketpair\fP (4)). If a pseudo-terminal is used, then its special |
| 91 | characters and modes (see \fIstty\fP (1)) are copied from the physical |
| 92 | terminal. A \fItermcap\fP (5) entry tailored to this window is created |
| 93 | and passed as environment (\fIenviron\fP (5)) variable |
| 94 | \fITERMCAP\fP. The termcap entry contains the window's size and |
| 95 | characteristics as well as information from the physical terminal, |
| 96 | such as the existence of underline, reverse video, and other display |
| 97 | modes, and the codes produced by the terminal's function keys, |
| 98 | if any. In addition to the termcap entry, a window size structure is |
| 99 | associated with the pseudo-terminal (and indeed with any terminal). It |
| 100 | is initialized by \fIwindow\fP at creation time, and updated whenever the |
| 101 | size of the window changes, using the \fIioctl\fP (2) call |
| 102 | \fITIOCSWINSZ\fP. In particular, the editor \fIvi\fP (1) uses |
| 103 | this information to redraw its display. |
| 104 | .SH OPERATION |
| 105 | .PP |
| 106 | During normal execution, \fIwindow\fP can be in one of two modes: |
| 107 | conversation mode and command mode. In conversation mode, the |
| 108 | terminal's real cursor is placed at the cursor position of a particular |
| 109 | window--called the current window--and input from the keyboard is sent |
| 110 | to the process in that window. The current window is always |
| 111 | on top of all other windows, except those in foreground. In addition, |
| 112 | it is set apart by highlighting its identifier and label in reverse video. |
| 113 | .PP |
| 114 | Typing \fIwindow\fP's escape character (normally ^P) in conversation |
| 115 | mode switches it into command mode. In command mode, the top line of |
| 116 | the terminal screen becomes the command prompt window, and \fIwindow\fP |
| 117 | interprets input from the keyboard as commands to manipulate windows. |
| 118 | .PP |
| 119 | There are two types of commands: short commands are usually one or two |
| 120 | key strokes; long commands are strings either typed by the user in the |
| 121 | command window (see the ``:'' command below), or read from a file (see |
| 122 | \fIsource\fP below). |
| 123 | .SH "SHORT COMMANDS" |
| 124 | Below, \fI#\fP represents one of the digits ``1'' to ``9'' |
| 125 | corresponding to the windows 1 to 9. \fI^X\fP means control-\fIX\fP, |
| 126 | where \fPX\fP is any character. In particular, \fI^^\fP is |
| 127 | control-^. \fIEscape\fP is the escape key, or \f^[\fP. |
| 128 | .TP |
| 129 | .B # |
| 130 | Select window \fI#\fP as the current window |
| 131 | and return to conversation mode. |
| 132 | .TP |
| 133 | .B %# |
| 134 | Select window \fI#\fP but stay in command mode. |
| 135 | .TP |
| 136 | .B ^^ |
| 137 | Select the previous window and return to conversation |
| 138 | mode. This is useful for toggling between two windows. |
| 139 | .TP |
| 140 | .B escape |
| 141 | Return to conversation mode. |
| 142 | .TP |
| 143 | .B ^P |
| 144 | Return to conversation mode and write ^P to the |
| 145 | current window. Thus, typing two ^P's in conversation |
| 146 | mode sends one to the current window. If the \fIwindow\fP |
| 147 | escape is changed to some other character, that |
| 148 | character takes the place of ^P here. |
| 149 | .TP |
| 150 | .B ? |
| 151 | List a short summary of commands. |
| 152 | .TP |
| 153 | .B ^L |
| 154 | Redraw the screen. |
| 155 | .TP |
| 156 | .B q |
| 157 | Exit \fIwindow\fP. Confirmation is requested. |
| 158 | .TP |
| 159 | .B ^Z |
| 160 | Suspend \fIwindow\fP. |
| 161 | .TP |
| 162 | .B w |
| 163 | Create a new window. The user is prompted for the positions |
| 164 | of the upper left and lower right corners of the window. |
| 165 | The cursor is placed on the screen and the keys ``h'', ``j'', |
| 166 | ``k'', and ``l'' |
| 167 | move the cursor left, down, up, and right, respectively. |
| 168 | The keys ``H'', ``J'', ``K'', and ``L'' move the cursor to the respective |
| 169 | limits of the screen. Typing a number before the movement keys |
| 170 | repeats the movement that number of times. Return enters the cursor position |
| 171 | as the upper left corner of the window. The lower right corner |
| 172 | is entered in the same manner. During this process, |
| 173 | the placement of the new window is indicated by a rectangular |
| 174 | box drawn on the screen, corresponding to where the new window |
| 175 | will be framed. Typing escape at any point |
| 176 | cancels this command. |
| 177 | .IP |
| 178 | This window becomes the current window, |
| 179 | and is given the first available ID. The default buffer size |
| 180 | is used (see \fInline\fP command below). |
| 181 | .IP |
| 182 | Only fully visible windows can be created this way. |
| 183 | .TP |
| 184 | .B c# |
| 185 | Close window \fI#\fP. The process in the window is sent |
| 186 | the hangup signal (see \fIkill\fP (1)). \fICsh\fP (1) should |
| 187 | handle this signal correctly and cause no problems. |
| 188 | .TP |
| 189 | .B m# |
| 190 | Move window \fI#\fP to another location. A box in the shape |
| 191 | of the window is drawn on |
| 192 | the screen to indicate the new position of the window, and the same keys as |
| 193 | those for the \fIw\fP command are used to position the box. The |
| 194 | window can be moved partially off-screen. |
| 195 | .TP |
| 196 | .B M# |
| 197 | Move window \fI#\fP to its previous position. |
| 198 | .TP |
| 199 | .B s# |
| 200 | Change the size of window \fI#\fP. The user is prompted |
| 201 | to enter the new lower right corner of the window. A box |
| 202 | is drawn to indicate the new window size. The same |
| 203 | keys used in \fIw\fP and \fIm\fP are used to enter the position. |
| 204 | .TP |
| 205 | .B S# |
| 206 | Change window \fI#\fP to its previous size. |
| 207 | .TP |
| 208 | .B ^Y |
| 209 | Scroll the current window up by one line. |
| 210 | .TP |
| 211 | .B ^E |
| 212 | Scroll the current window down by one line. |
| 213 | .TP |
| 214 | .B ^U |
| 215 | Scroll the current window up by half the window size. |
| 216 | .TP |
| 217 | .B ^D |
| 218 | Scroll the current window down by half the window size. |
| 219 | .TP |
| 220 | .B ^B |
| 221 | Scroll the current window up by the full window size. |
| 222 | .TP |
| 223 | .B ^F |
| 224 | Scroll the current window down by the full window size. |
| 225 | .TP |
| 226 | .B h |
| 227 | Move the cursor of the current window left by one column. |
| 228 | .TP |
| 229 | .B j |
| 230 | Move the cursor of the current window down by one line. |
| 231 | .TP |
| 232 | .B k |
| 233 | Move the cursor of the current window up by one line. |
| 234 | .TP |
| 235 | .B l |
| 236 | Move the cursor of the current window right by one column. |
| 237 | .TP |
| 238 | .B ^S |
| 239 | Stop output in the current window. |
| 240 | .TP |
| 241 | .B ^Q |
| 242 | Start output in the current window. |
| 243 | .TP |
| 244 | .B : |
| 245 | Enter a line to be executed as long commands. Normal line |
| 246 | editing characters (erase character, erase word, erase line) are |
| 247 | supported. |
| 248 | .SH "LONG COMMANDS" |
| 249 | Long commands are a sequence of statements |
| 250 | parsed much like a programming language, with a syntax |
| 251 | similar to that of C. Numeric and string expressions and variables |
| 252 | are supported, as well as conditional statements. |
| 253 | .PP |
| 254 | There are two data types: string and number. A string is a sequence |
| 255 | of letters or digits beginning with a letter. ``_'' and ``.'' are |
| 256 | considered letters. Alternately, non-alphanumeric characters can |
| 257 | be included in strings by quoting them in ``"'' or escaping them |
| 258 | with ``\\''. In addition, the ``\\'' sequences of C are supported, |
| 259 | both inside and outside quotes (e.g., ``\\n'' is a new line, |
| 260 | ``\\r'' a carriage return). For example, these are legal strings: |
| 261 | abcde01234, "&#$^*&#", ab"$#"cd, ab\\$\\#cd, "/usr/ucb/window". |
| 262 | .PP |
| 263 | A number is an integer value in one of three forms: |
| 264 | a decimal number, an octal number preceded by ``0'', |
| 265 | or a hexadecimal number preceded by ``0x'' or ``0X''. The natural |
| 266 | machine integer size is used (i.e., the signed integer type |
| 267 | of the C compiler). As in C, a non-zero number represents |
| 268 | a boolean true. |
| 269 | .PP |
| 270 | The character ``#'' begins a comment which terminates at the |
| 271 | end of the line. |
| 272 | .PP |
| 273 | A statement is either a conditional or an expression. Expression |
| 274 | statements are terminated with a new line or ``;''. To continue |
| 275 | an expression on the next line, terminate the first line with ``\\''. |
| 276 | .SH "CONDITIONAL STATEMENT" |
| 277 | \fIWindow\fP has a single control structure: |
| 278 | the fully bracketed if statement in the form |
| 279 | .nf |
| 280 | if <expr> then |
| 281 | <statement> |
| 282 | . . . |
| 283 | elsif <expr> then |
| 284 | <statement> |
| 285 | . . . |
| 286 | else |
| 287 | <statement> |
| 288 | . . . |
| 289 | endif |
| 290 | .fi |
| 291 | The \fIelse\fP and \fIelsif\fP parts are optional, and the latter can |
| 292 | be repeated any number of times. \fI<Expr>\fP must be numeric. |
| 293 | .SH EXPRESSIONS |
| 294 | Expressions in \fIwindow\fP are similar to those in the |
| 295 | C language, with most C operators supported on numeric |
| 296 | operands. In addition, some are overloaded to operate on strings. |
| 297 | .PP |
| 298 | When an expression is used as a statement, its value is discarded |
| 299 | after evaluation. Therefore, only expressions with side |
| 300 | effects (assignments and function calls) are useful as statements. |
| 301 | .PP |
| 302 | Single valued (no arrays) variables are supported, of both |
| 303 | numeric and string values. Some variables are predefined. They |
| 304 | are listed below. |
| 305 | .PP |
| 306 | The operators in order of increasing precedence: |
| 307 | .TP |
| 308 | .B <expr1> = <expr2> |
| 309 | Assignment. The variable of name \fI<expr1>\fP, which must be string valued, |
| 310 | is assigned the result of \fI<expr2>\fP. Returns the value of \fI<expr2>\fP. |
| 311 | .TP |
| 312 | .B <expr1> ? <expr2> : <expr3> |
| 313 | Returns the value of \fI<expr2>\fP if \fI<expr1>\fP evaluates true |
| 314 | (non-zero numeric value); returns the value of \fI<expr3>\fP otherwise. Only |
| 315 | one of \fI<expr2>\fP and \fI<expr3>\fP is evaluated. \fI<Expr1>\fP must |
| 316 | be numeric. |
| 317 | .TP |
| 318 | .B <expr1> || <expr2> |
| 319 | Logical or. Numeric values only. Short circuit evaluation is supported |
| 320 | (i.e., if \fI<expr1>\fP evaluates true, then \fI<expr2>\fP is not evaluated). |
| 321 | .TP |
| 322 | .B <expr1> && <expr2> |
| 323 | Logical and with short circuit evaluation. Numeric values only. |
| 324 | .TP |
| 325 | .B <expr1> | <expr2> |
| 326 | Bitwise or. Numeric values only. |
| 327 | .TP |
| 328 | .B <expr1> ^ <expr2> |
| 329 | Bitwise exclusive or. Numeric values only. |
| 330 | .TP |
| 331 | .B <expr1> & <expr2> |
| 332 | Bitwise and. Numeric values only. |
| 333 | .TP |
| 334 | .B <expr1> == <expr2>, <expr1> != <expr2> |
| 335 | Comparison (equal and not equal, respectively). The boolean |
| 336 | result (either 1 or 0) of the comparison is returned. The |
| 337 | operands can be numeric or string valued. One string operand |
| 338 | forces the other to be converted to a string in necessary. |
| 339 | .TP |
| 340 | .B <expr1> < <expr2>, <expr1> > <expr2>, <expr1> <= <expr2>, <expr1> >= <expr2> |
| 341 | Less than, greater than, less than or equal to, |
| 342 | greater than or equal to. Both numeric and string values, with |
| 343 | automatic conversion as above. |
| 344 | .TP |
| 345 | .B <expr1> << <expr2>, <expr1> >> <expr2> |
| 346 | If both operands are numbers, \fI<expr1>\fP is bit |
| 347 | shifted left (or right) by \fI<expr2>\fP bits. If \fI<expr1>\fP is |
| 348 | a string, then its first (or last) \fI<expr2>\fP characters are |
| 349 | returns (if \fI<expr2>\fP is also a string, then its length is used |
| 350 | in place of its value). |
| 351 | .TP |
| 352 | .B <expr1> + <expr2>, <expr1> - <expr2> |
| 353 | Addition and subtraction on numbers. For ``+'', if one |
| 354 | argument is a string, then the other is converted to a string, |
| 355 | and the result is the concatenation of the two strings. |
| 356 | .TP |
| 357 | .B <expr1> * <expr2>, <expr1> / <expr2>, <expr1> % <expr2> |
| 358 | Multiplication, division, modulo. Numbers only. |
| 359 | .TP |
| 360 | .B -<expr>, ~<expr>, !<expr>, $<expr>, $?<expr> |
| 361 | The first three are unary minus, bitwise complement and logical complement |
| 362 | on numbers only. The operator, ``$'', takes \fI<expr>\fP and returns |
| 363 | the value of the variable of that name. If \fI<expr>\fP is numeric |
| 364 | with value \fIn\fP and it appears within an alias macro (see below), |
| 365 | then it refers to the nth argument of the alias invocation. ``$?'' |
| 366 | tests for the existence of the variable \fI<expr>\fP, and returns 1 |
| 367 | if it exists or 0 otherwise. |
| 368 | .TP |
| 369 | .B <expr>(<arglist>) |
| 370 | Function call. \fI<Expr>\fP must be a string that is the unique |
| 371 | prefix of the name of a builtin \fIwindow\fP function |
| 372 | or the full name of a user defined alias macro. In the case of a builtin |
| 373 | function, \fI<arglist>\fP can be in one of two forms: |
| 374 | .br |
| 375 | <expr1>, <expr2>, . . . |
| 376 | .br |
| 377 | argname1 = <expr1>, argname2 = <expr2>, . . . |
| 378 | .br |
| 379 | The two forms can in fact be intermixed, but the result is |
| 380 | unpredictable. Most arguments can be omitted; default values will |
| 381 | be supplied for them. The \fIargnames\fP can be unique prefixes |
| 382 | of the the argument names. The commas separating |
| 383 | arguments are used only to disambiguate, and can usually be omitted. |
| 384 | .IP |
| 385 | Only the first argument form is valid for user defined aliases. Aliases |
| 386 | are defined using the \fIalias\fP builtin function (see below). Arguments |
| 387 | are accessed via a variant of the variable mechanism (see ``$'' operator |
| 388 | above). |
| 389 | .IP |
| 390 | Most functions return value, but some are used for side effect |
| 391 | only and so must be used as statements. When a function or an alias is used |
| 392 | as a statement, the parenthesis surrounding |
| 393 | the argument list may be omitted. Aliases return no value. |
| 394 | .SH "BUILTIN FUNCTIONS" |
| 395 | The arguments are listed by name in their natural |
| 396 | order. Optional arguments are in square brackets (``[ ]''). Arguments |
| 397 | that have no names are in angle brackets (``<>''). |
| 398 | .TP |
| 399 | .B alias([<string>], [<string-list>]) |
| 400 | If no argument is given, all currently defined alias macros are |
| 401 | listed. Otherwise, \fI<string>\fP is defined as an alias, |
| 402 | with expansion \fI<string-list>\fP. The previous definition of |
| 403 | \fI<string>\fP, if any, is returned. Default for \fI<string-list>\fP |
| 404 | is no change. |
| 405 | .TP |
| 406 | .B close(<window-list>) |
| 407 | Close the windows specified in \fI<window-list>\fP. If \fI<window-list>\fP |
| 408 | is the word \fIall\fP, than all windows are closed. No value is returned. |
| 409 | .TP |
| 410 | .B cursormodes([modes]) |
| 411 | Set the window cursor to \fImodes\fP. \fIModes\fP is the bitwise |
| 412 | or of the mode bits defined as the variables \fIm_ul\fP (underline), |
| 413 | \fIm_rev\fP (reverse video), \fIm_blk\fP (blinking), |
| 414 | and \fIm_grp\fP (graphics, terminal dependent). Return |
| 415 | value is the previous modes. Default is no change. |
| 416 | For example, cursor($m_rev|$m_blk) sets the window cursors to blinking |
| 417 | reverse video. |
| 418 | .TP |
| 419 | .B echo([window], [<string-list>]) |
| 420 | Write the list of strings, \fI<string-list>\fP, to \fIwindow\fP, separated |
| 421 | by spaces and terminated with a new line. The strings are only |
| 422 | displayed in the window, the process in the window are not |
| 423 | involved (see \fIwrite\fP below). No value is returned. Default |
| 424 | is the current window. |
| 425 | .TP |
| 426 | .B escape([escapec]) |
| 427 | Set the escape character to \fIescape-char\fP. Returns the old |
| 428 | escape character as a one character string. Default is no |
| 429 | change. \fPEscapec\fP can be a string of a single character, or |
| 430 | in the form \fI^X\fP, meaning control-\fIX\fP. |
| 431 | .TP |
| 432 | .B foreground([window], [flag]) |
| 433 | Move \fIwindow\fP in or out of foreground. \fIFlag\fP |
| 434 | can be one of \fIon\fP, \fIoff\fP, |
| 435 | \fIyes\fP, \fIno\fP, \fItrue\fP, or \fIfalse\fP, with obvious |
| 436 | meanings, or it can be a numeric expression, in which case |
| 437 | a non-zero value is true. Returns the old foreground flag |
| 438 | as a number. Default for \fIwindow\fP is the current window, |
| 439 | default for \fIflag\fP is no change. |
| 440 | .TP |
| 441 | .B label([window], [label]) |
| 442 | Set the label of \fIwindow\fP to \fIlabel\fP. Returns the old |
| 443 | label as a string. Default for \fIwindow\fP is the current |
| 444 | window, default for \fIlabel\fP is no change. To turn |
| 445 | off a label, set it to an empty string (""). |
| 446 | .TP |
| 447 | .B list() |
| 448 | No arguments. List the identifiers and labels of all windows. No |
| 449 | value is returned. |
| 450 | .TP |
| 451 | .B nline([nline]) |
| 452 | Set the default buffer size to \fInline\fP. Initially, it is |
| 453 | 48 lines. Returns the old default buffer size. Default is |
| 454 | no change. Using a very large buffer can slow the program down |
| 455 | considerably. |
| 456 | .TP |
| 457 | .B select([window]) |
| 458 | Make \fIwindow\fP the current window. The previous current window |
| 459 | is returned. Default is no change. |
| 460 | .TP |
| 461 | .B shell([<string-list>]) |
| 462 | Set the default window shell program to \fI<string-list>\fP. Returns |
| 463 | the first string in the old shell setting. Default is no change. Initially, |
| 464 | the default shell is taken from the environment variable \fISHELL\fP. |
| 465 | .TP |
| 466 | .B source(filename) |
| 467 | Read and execute the long commands in \fIfilename\fP. Returns |
| 468 | -1 if the file cannot be read, 0 otherwise. |
| 469 | .TP |
| 470 | .B terse([flag]) |
| 471 | Set terse mode to \fIflag\fP. In terse mode, the command window |
| 472 | stays hidden even in command mode, and errors are reported by |
| 473 | sounding the terminal's bell. \fIFlag\fP can take on the same |
| 474 | values as in \fIforeground\fP above. Returns the old terse flag. |
| 475 | Default is no change. |
| 476 | .TP |
| 477 | .B unalias(alias) |
| 478 | Undefine \fIalias\fP. Returns -1 if \fIalias\fP does not exist, |
| 479 | 0 otherwise. |
| 480 | .TP |
| 481 | .B unset(variable) |
| 482 | Undefine \fIvariable\fP. Returns -1 if \fIvariable\fP does not exist, |
| 483 | 0 otherwise. |
| 484 | .TP |
| 485 | .B variables() |
| 486 | No arguments. List all variables. No value is returned. |
| 487 | .TP |
| 488 | .B window([row], [column], [nrow], [ncol], [nline], [frame], |
| 489 | .B [pty], [mapnl], [shell]) |
| 490 | .br |
| 491 | Open a window with upper left corner at \fIrow\fP, \fIcolumn\fP |
| 492 | and size \fInrow\fP, \fIncol\fP. If \fInline\fP is specified, |
| 493 | then that many lines are allocated for the text buffer. Otherwise, |
| 494 | the default buffer size is used. Default values for |
| 495 | \fIrow\fP, \fIcolumn\fP, \fInrow\fP, and \fIncol\fP are, respectively, |
| 496 | the upper, left-most, lower, or right-most extremes of the |
| 497 | screen. \fIFrame\fP, \fIpty\fP, and \fImapnl\fP are flag values |
| 498 | interpreted in the same way as the argument to \fIforeground\fP (see above); |
| 499 | they mean, respectively, put a frame around this window (default true), |
| 500 | allocate pseudo-terminal for this window rather than socketpair (default |
| 501 | true), and map new line characters in this window to carriage return |
| 502 | and line feed (default true if socketpair is used, false otherwise). |
| 503 | \fIShell\fP is a list of strings that will be used as the shell |
| 504 | program to place in the window (default is the program specified |
| 505 | by \fIshell\fP, see below). The created window's identifier |
| 506 | is returned as a number. |
| 507 | .TP |
| 508 | .B write([window], [<string-list>]) |
| 509 | Send the list of strings, \fI<string-list>\fP, to \fIwindow\fP, separated |
| 510 | by spaces but not terminated with a new line. The strings are actually |
| 511 | given to the window as input. No value is returned. Default |
| 512 | is the current window. |
| 513 | .SH "PREDEFINED VARIABLES" |
| 514 | These variables are for information only. Redefining them does |
| 515 | not affect the internal operation of \fIwindow\fP. |
| 516 | .TP |
| 517 | .B baud |
| 518 | The baud rate as a number between 50 and 38400. |
| 519 | .TP |
| 520 | .B modes |
| 521 | The display modes (reverse video, underline, blinking, graphics) |
| 522 | supported by the physical terminal. The value of \fImodes\fP is |
| 523 | the bitwise or of some of the one bit values, \fIm_blk\fP, \fIm_grp\fP, |
| 524 | \fIm_rev\fP, and \fIm_ul\fP (see below). These values are useful |
| 525 | in setting the window cursors' modes (see \fIcursormodes\fP above). |
| 526 | .TP |
| 527 | .B m_blk |
| 528 | The blinking mode bit. |
| 529 | .TP |
| 530 | .B m_grp |
| 531 | The graphics mode bit (not very useful). |
| 532 | .TP |
| 533 | .B m_rev |
| 534 | The reverse video mode bit. |
| 535 | .TP |
| 536 | .B m_ul |
| 537 | The underline mode bit. |
| 538 | .TP |
| 539 | .B ncol |
| 540 | The number of columns on the physical screen. |
| 541 | .TP |
| 542 | .B nrow |
| 543 | The number of rows on the physical screen. |
| 544 | .TP |
| 545 | .B term |
| 546 | The terminal type. The standard name, found in the second name |
| 547 | field of the terminal's \fITERMCAP\fP entry, is used. |
| 548 | .SH FILES |
| 549 | .ta 15 |
| 550 | ~/.windowrc startup command file. |
| 551 | .br |
| 552 | /dev/[pt]ty[pq]? pseudo-terminal devices. |
| 553 | .SH DIAGNOSTICS |
| 554 | Should be self explanatory. |
| 555 | .SH BUGS |