Commit | Line | Data |
---|---|---|
7edc52ec | 1 | .\" @(#)window.1 3.6 %G% |
93d5bf32 EW |
2 | .TH WINDOW 1 local |
3 | .SH NAME | |
4 | window \- multiple window shell | |
5 | .SH SYNOPSIS | |
05631f05 EW |
6 | .B window |
7 | [ | |
8 | .B \-t | |
9 | ] [ | |
10 | .B \-f | |
11 | ] [ | |
12 | .B \-d | |
13 | ] [ | |
14 | .B -e escape-char | |
15 | ] | |
93d5bf32 EW |
16 | .SH DESCRIPTION |
17 | \fIWindow\fP provides a window oriented working environment | |
18 | on ordinary CRT terminals. | |
19 | .PP | |
20 | Windows are rectangular partitions on the physical terminal screen | |
f85ea165 | 21 | that are indistinguishable from real terminals to processes running in |
05631f05 | 22 | them. Their sizes are determined at creation |
93d5bf32 EW |
23 | time. They are framed as necessary to mark the boundaries between |
24 | windows. Each window, like terminals, has a cursor and a set of | |
25 | control functions. Most intelligent terminal functions such as line and | |
05631f05 EW |
26 | character deletion and insertion are supported. Display modes |
27 | such as underlining and reverse video are supported if the terminal | |
28 | allows them. | |
f85ea165 | 29 | .PP |
430fecd4 EW |
30 | Each window has a text buffer which can be larger than the window. |
31 | Different parts of the buffer can be made visible through scrolling. | |
32 | .PP | |
e4414eae | 33 | Windows are labeled with the digits ``1'' through ``9'', |
05631f05 | 34 | thus a maximum of nine windows can exist at the same time. |
93d5bf32 | 35 | One window, the current window, is treated specially. |
05631f05 | 36 | This window is indicated by displaying its labels in reverse video. |
f85ea165 EW |
37 | .PP |
38 | Windows can overlap. Some can be completely obscured by others. | |
bdfe3733 | 39 | The current window is always on top of all others. |
93d5bf32 | 40 | .PP |
9c9f7aa9 EW |
41 | Windows need not be completely within the edges of the terminal screen. |
42 | Thus a large window (possibly larger than the physical screen) | |
43 | can be placed to show only a portion of its full size. This | |
44 | feature can in some situations replace the ability to change | |
45 | window sizes which is not supported. | |
46 | .PP | |
05631f05 EW |
47 | With each newly created window, a shell program is spawned with its |
48 | process environment tailored to that window. In particular, | |
49 | a pseudo-terminal device (\fIpty (4)\fP) is allocated, and becomes | |
9c9f7aa9 | 50 | the standard input, output and diagnostic output of the shell. Its |
05631f05 EW |
51 | special characters and modes (see \fIstty (1)\fP) are copied from |
52 | the user's real terminal. Also, | |
53 | a \fItermcap (5)\fP entry for this window is created | |
54 | and passed to the shell as \fIenviron (8)\fP | |
55 | variable \fBTERMCAP\fP. This \fItermcap\fP entry contains the window's | |
56 | size and characteristics as well as information about | |
57 | the real terminal, such as the existence of underline, reverse | |
58 | video and other display modes, and the codes produced by the terminal's | |
430fecd4 EW |
59 | keypad (if any). The name of the shell program used is obtained from |
60 | the environment variable \fBSHELL\fP. | |
05631f05 EW |
61 | .PP |
62 | When \fIwindow\fP starts up, the file \fI.windowrc\fP in the | |
63 | user's home directory is checked. If it exists, then the | |
64 | commands contained in it are executed (see \fIsource\fP command below). | |
65 | If \fI.windowrc\fP does not exist, then two | |
66 | equal sized windows are created by default. | |
67 | .PP | |
68 | The command line arguments are | |
69 | .TP | |
70 | .B -t | |
71 | Turn on terse mode (see \fIterse\fP command below). | |
72 | .TP | |
73 | .B -f | |
74 | Don't perform any startup action. | |
75 | .TP | |
76 | .B -d | |
77 | Ignore \fI.windowrc\fP and create the two default | |
78 | windows instead. | |
79 | .TP | |
80 | .B -e escape-char | |
81 | Set the escape character to \fIescape-char\fP. | |
82 | .PP | |
f85ea165 EW |
83 | The \fIwindow\fP program has two functional modes: command mode |
84 | and conversation mode. | |
f85ea165 | 85 | In conversation mode, the terminal's |
93d5bf32 EW |
86 | real cursor is placed at the cursor position of the current |
87 | window and all keyboard input is sent to the process in that | |
88 | window. Output from windows is displayed at all times, | |
89 | even in command mode. | |
f85ea165 EW |
90 | Typing \fIwindow\fP's escape character (normally ^P) |
91 | in conversation mode switches \fIwindow\fP into | |
93d5bf32 | 92 | command mode. In command mode, the top line of the |
05631f05 | 93 | terminal screen becomes the command prompt window. |
93d5bf32 | 94 | .PP |
e4414eae | 95 | There are two types of commands. Short commands are |
f07b3693 EW |
96 | usually one or two key strokes. Long commands are |
97 | in the command window (see the ``:'' command below), | |
98 | or read from a file (see \fIsource\fP below). They are parsed | |
99 | much like conventional programming languages, with a syntax | |
100 | similar to that of C. Numeric and string expressions and variables | |
101 | are supported, as well as | |
102 | conditional statements (if . . .). The grammar is described below. | |
e4414eae | 103 | .PP |
f07b3693 EW |
104 | The short commands. Below, \fI[1-9]\fP represents one of the |
105 | keys ``1'' through ``9,'' used to select the correponding window | |
106 | ``1'' through ``9.'' | |
93d5bf32 EW |
107 | .TP |
108 | .B [1-9] | |
f85ea165 EW |
109 | Select window \fI[1-9]\fP as the current window |
110 | and return to conversation mode. | |
93d5bf32 EW |
111 | .TP |
112 | .B %[1-9] | |
f85ea165 | 113 | Select window \fI[1-9]\fP but stay in command mode. |
93d5bf32 EW |
114 | .TP |
115 | .B ? | |
116 | List a short summary of commands. | |
117 | .TP | |
f85ea165 EW |
118 | .B ^L |
119 | Redraw the screen. | |
120 | .TP | |
93d5bf32 EW |
121 | .B escape |
122 | Return to conversation mode. | |
123 | .TP | |
124 | .B ^P | |
125 | Return to conversation mode and write ^P to the | |
126 | current window. Thus, typing two ^P's in conversation | |
127 | mode sends one to the current window. If the \fIwindow\fP | |
128 | escape is changed to some other character, that | |
f85ea165 | 129 | character takes the place of ^P here. |
93d5bf32 | 130 | .TP |
9c9f7aa9 EW |
131 | .B ^^ |
132 | Select the previous current window and return to conversation | |
133 | mode. This is useful for toggling between two windows. | |
134 | .TP | |
f85ea165 EW |
135 | .B q |
136 | Exit \fIwindow\fP. Confirmation is requested. | |
93d5bf32 | 137 | .TP |
05631f05 EW |
138 | .B ^Z |
139 | Suspend \fIwindow\fP. | |
140 | .TP | |
93d5bf32 | 141 | .B w |
f85ea165 EW |
142 | Create a new window. You are prompted for the positions |
143 | of the upper left and lower right corners of the window. | |
e4414eae EW |
144 | The cursor is placed on the screen and the keys ``h'', ``j'', |
145 | ``k'', and ``l'' | |
146 | move the cursor left, down, up, and right, respectively. | |
147 | The keys ``H'', ``J'', ``K'', and ``L'' move the cursor to the respective | |
05631f05 | 148 | limits of the screen. Typing a number before the movement keys |
f85ea165 | 149 | repeats the movement that number of times. |
e4414eae | 150 | Return enters the cursor position |
93d5bf32 | 151 | as the upper left corner of the window. The lower right corner |
f07b3693 EW |
152 | is entered in the same manner. During this process, |
153 | the position and size of the new window are indicated by a rectangular | |
154 | box drawn on the screen. Typing escape (or ^[) at any point | |
155 | cancels this command. | |
93d5bf32 | 156 | .IP |
05631f05 | 157 | This window becomes the current window, |
430fecd4 EW |
158 | and is given the first available label. The default buffer size |
159 | is used (see \fIbuffer\fP command below). | |
9c9f7aa9 | 160 | .IP |
f07b3693 | 161 | Only fully visible windows can be created this way. |
93d5bf32 EW |
162 | .TP |
163 | .B c[1-9] | |
05631f05 | 164 | Close window \fI[1-9]\fP. The process in the window is sent |
f85ea165 | 165 | the hangup signal (see \fIkill (1)\fP). \fICsh (1)\fP should |
93d5bf32 EW |
166 | handle this signal correctly and cause no problems. |
167 | .TP | |
168 | .B C | |
93d5bf32 EW |
169 | Close all windows. |
170 | .TP | |
9c9f7aa9 | 171 | .B m[1-9] |
f07b3693 EW |
172 | Move window \fI[1-9]\fP to another location. A box in the shape |
173 | of the window is drawn on | |
174 | the screen to indicate the new position of the window, and the same keys as | |
175 | those for the ``w'' command are used to position the box. The | |
9c9f7aa9 EW |
176 | window can be moved partially off-screen. |
177 | .TP | |
178 | .B M[1-9] | |
179 | Move window \fI[1-9]\fP to its previous position. | |
180 | .TP | |
f85ea165 | 181 | .B S |
93d5bf32 EW |
182 | Show all windows. Each window is brought to the top in sequence, |
183 | with the terminal cursor placed on its label. Typing escape | |
e4414eae | 184 | at this point will select the displayed window as the current window. |
f07b3693 EW |
185 | Return will display the next one. This command is sometimes confusing, |
186 | but useful when there are a large number of windows and some are completely | |
f85ea165 | 187 | hidden by others. |
93d5bf32 | 188 | .TP |
05631f05 | 189 | .B L |
f07b3693 | 190 | List all windows with their labels and the states of their shell processes. |
05631f05 EW |
191 | .TP |
192 | .B ^Y | |
193 | Scroll the current window up by one line. | |
194 | .TP | |
195 | .B ^E | |
196 | Scroll the current window down by one line. | |
197 | .TP | |
93d5bf32 EW |
198 | .B ^U |
199 | Scroll the current window up by half the window size. | |
200 | .TP | |
201 | .B ^D | |
202 | Scroll the current window down by half the window size. | |
203 | .TP | |
204 | .B ^B | |
205 | Scroll the current window up by the full window size. | |
206 | .TP | |
207 | .B ^F | |
208 | Scroll the current window down by the full window size. | |
209 | .TP | |
210 | .B h | |
211 | Move the cursor of the current window left by one column. | |
212 | .TP | |
213 | .B j | |
214 | Move the cursor of the current window down by one line. | |
215 | .TP | |
216 | .B k | |
217 | Move the cursor of the current window up by one line. | |
218 | .TP | |
219 | .B l | |
220 | Move the cursor of the current window right by one column. | |
221 | .TP | |
9c9f7aa9 EW |
222 | .B v |
223 | List all variables. All currently defined variables are listed | |
224 | with their values. | |
225 | .TP | |
f85ea165 | 226 | .B : |
f07b3693 EW |
227 | Enter a line to be executed as long commands. Normal line |
228 | editing characters (erase character, erase word, erase line) are | |
229 | supported. | |
9c9f7aa9 | 230 | .PP |
f07b3693 EW |
231 | Long commands. A long command is either a conditional statement |
232 | or a simple command. The simple long command consists of a | |
233 | command name followed by | |
234 | a list of arguments, terminated with newline or ``;''. A command can | |
235 | be continued on the next line by ending the first line with ``\\''. The | |
236 | arguments can be numeric or string expressions. Window supports both numeric | |
237 | and string values. A string is any word beginning with a letter or | |
238 | ``_'', followed by letters, digits, or ``_''. Alternately, strings | |
239 | can be quoted in ``"'' to include non-alphanumeric characters. Numeric | |
240 | values are simple strings of digits. Boolean | |
241 | values are represented by a numeric value not equal to zero. The supported operators in increasing | |
9c9f7aa9 EW |
242 | precedence are |
243 | .TP | |
244 | .B "boolean_expr ? expr1 : expr2" | |
245 | Returns \fIexpr1\fP | |
246 | if \fIboolean_expr\fP is true, \fIexpr2\fP otherwise. | |
247 | .TP | |
248 | .B boolean_expr1 || boolean_expr2 | |
249 | Logical or. Short circuit evaluation is supported. | |
250 | .TP | |
251 | .B boolean_expr1 && boolean_expr2 | |
252 | Logical and, with short circuit evaluation. | |
253 | .TP | |
254 | .B numeric_expr1 | numeric_expr2 | |
255 | Bitwise or. | |
256 | .TP | |
257 | .B numeric_expr1 ^ numeric_expr2 | |
258 | Bitwise exclusive-or. | |
259 | .TP | |
260 | .B numeric_expr1 & numeric_expr2 | |
261 | Bitwise and. | |
262 | .TP | |
263 | .B expr1 == expr2, expr1 != expr2 | |
264 | Comparison (equal and not-equal, respectively). The boolean | |
265 | result of the comparison is returned. The arguments can be numeric | |
266 | or strings. | |
267 | .TP | |
268 | .B expr1 < expr2, expr1 > expr2, expr1 <= expr2, expr1 >= expr2 | |
269 | Less than, greater than, less than or equal to, greater than or equal to. | |
270 | .TP | |
271 | .B numeric_expr1 << numeric_expr2, numeric_expr1 >> numeric_expr2, | |
272 | \fINumeric_expr1\fP is bit shifted left (or right) by \fInumeric_expr2\fP | |
273 | bits. | |
274 | .TP | |
275 | .B numeric_expr1 + numeric_expr2, numeric_expr1 - numeric_expr2 | |
276 | Addition, subtraction. | |
277 | .TP | |
278 | .B numeric_expr1 * numeric_expr2, numeric_expr1 / numeric_expr2, numeric_expr1 % numeric_expr2 | |
279 | Multiplication, division, modulo. | |
280 | .TP | |
281 | .B - numeric_expr, + numeric_expr, ~ numeric_expr, ! boolean_expr | |
282 | Unary minus, unary plus, bitwise complement, logical complement. | |
f85ea165 | 283 | .PP |
e4414eae | 284 | The long commands: |
f85ea165 EW |
285 | .TP |
286 | .B escape C | |
287 | Set the escape character to \fIC\fP. | |
288 | .TP | |
289 | .B terse [off] | |
290 | Turn on (or off) terse mode. In terse mode, the command window | |
291 | stays hidden even in command mode, and errors are reported by | |
292 | sounding the terminal's bell. | |
293 | .TP | |
430fecd4 | 294 | .B window row col nrow ncol [nline] |
f85ea165 | 295 | Open a window with upper left corner at \fIrow\fP, \fIcol\fP |
430fecd4 EW |
296 | and size \fInrow\fP, \fIncol\fP. If \fInline\fP is specified, |
297 | then that many lines is allocated for the text buffer. Otherwise, | |
298 | the default buffer size is used. Using a \fB``*''\fP in place of | |
299 | \fIrow\fP, \fIcol\fP, \fInrow\fP, or \fIncol\fP gives, respectively, | |
300 | the up, left, down, or right extremes of the screen. | |
301 | .TP | |
302 | .B buffer nline | |
303 | Set the default buffer size to \fInline\fP. Initially, it is | |
304 | 48 lines. Using a very large buffer can slow the program down | |
305 | considerably. | |
f85ea165 EW |
306 | .TP |
307 | .B label [1-9] string | |
05631f05 | 308 | Label window \fI[1-9]\fP with \fIstring\fP. This is in addition |
e4414eae | 309 | to the numeric label that is always displayed. |
f85ea165 EW |
310 | .TP |
311 | .B %[1-9] | |
312 | Make window \fI[1-9]\fP the current window. | |
313 | .TP | |
05631f05 EW |
314 | .B write [1-9] string |
315 | Write \fIstring\fP to window \fI[1-9]\fP. | |
316 | .TP | |
317 | .B close [1-9] ... | |
318 | Close window \fI[1-9]\fP. More than one window can be specified. | |
319 | If no window is given, then all windows are closed. | |
320 | .TP | |
f85ea165 | 321 | .B source file |
e4414eae | 322 | Read and execute the long commands in \fIfile\fP. Recursive |
f85ea165 | 323 | \fIsource\fP is not allowed. |
93d5bf32 EW |
324 | .SH FILES |
325 | .ta 15 | |
f85ea165 EW |
326 | ~/.windowrc startup command file. |
327 | .br | |
93d5bf32 | 328 | /dev/ptyp? pseudo-terminal devices. |
93d5bf32 EW |
329 | .SH DIAGNOSTICS |
330 | Should be self explanatory. | |
331 | .SH BUGS | |
93d5bf32 EW |
332 | When a window is scrolled or the cursor moved, output from |
333 | the process in the window will be displayed at the new cursor | |
334 | position. This is consistent with real terminals but | |
335 | not always desirable. |