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