support graphics if setup by somebody else.
[unix-history] / usr / src / usr.bin / window / window.1
CommitLineData
430fecd4 1.\" @(#)window.1 3.3 83/08/25
93d5bf32
EW
2.TH WINDOW 1 local
3.SH NAME
4window \- 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
18on ordinary CRT terminals.
19.PP
20Windows are rectangular partitions on the physical terminal screen
f85ea165 21that are indistinguishable from real terminals to processes running in
05631f05 22them. Their sizes are determined at creation
93d5bf32
EW
23time. They are framed as necessary to mark the boundaries between
24windows. Each window, like terminals, has a cursor and a set of
25control functions. Most intelligent terminal functions such as line and
05631f05
EW
26character deletion and insertion are supported. Display modes
27such as underlining and reverse video are supported if the terminal
28allows them.
f85ea165 29.PP
430fecd4
EW
30Each window has a text buffer which can be larger than the window.
31Different parts of the buffer can be made visible through scrolling.
32.PP
e4414eae 33Windows are labeled with the digits ``1'' through ``9'',
05631f05 34thus a maximum of nine windows can exist at the same time.
93d5bf32 35One window, the current window, is treated specially.
05631f05 36This window is indicated by displaying its labels in reverse video.
f85ea165
EW
37.PP
38Windows can overlap. Some can be completely obscured by others.
bdfe3733 39The current window is always on top of all others.
93d5bf32 40.PP
05631f05
EW
41With each newly created window, a shell program is spawned with its
42process environment tailored to that window. In particular,
43a pseudo-terminal device (\fIpty (4)\fP) is allocated, and becomes
44the standard input, output and diagnostic output of the shell. It's
45special characters and modes (see \fIstty (1)\fP) are copied from
46the user's real terminal. Also,
47a \fItermcap (5)\fP entry for this window is created
48and passed to the shell as \fIenviron (8)\fP
49variable \fBTERMCAP\fP. This \fItermcap\fP entry contains the window's
50size and characteristics as well as information about
51the real terminal, such as the existence of underline, reverse
52video and other display modes, and the codes produced by the terminal's
430fecd4
EW
53keypad (if any). The name of the shell program used is obtained from
54the environment variable \fBSHELL\fP.
05631f05
EW
55.PP
56When \fIwindow\fP starts up, the file \fI.windowrc\fP in the
57user's home directory is checked. If it exists, then the
58commands contained in it are executed (see \fIsource\fP command below).
59If \fI.windowrc\fP does not exist, then two
60equal sized windows are created by default.
61.PP
62The command line arguments are
63.TP
64.B -t
65Turn on terse mode (see \fIterse\fP command below).
66.TP
67.B -f
68Don't perform any startup action.
69.TP
70.B -d
71Ignore \fI.windowrc\fP and create the two default
72windows instead.
73.TP
74.B -e escape-char
75Set the escape character to \fIescape-char\fP.
76.PP
f85ea165
EW
77The \fIwindow\fP program has two functional modes: command mode
78and conversation mode.
f85ea165 79In conversation mode, the terminal's
93d5bf32
EW
80real cursor is placed at the cursor position of the current
81window and all keyboard input is sent to the process in that
82window. Output from windows is displayed at all times,
83even in command mode.
f85ea165
EW
84Typing \fIwindow\fP's escape character (normally ^P)
85in conversation mode switches \fIwindow\fP into
93d5bf32 86command mode. In command mode, the top line of the
05631f05 87terminal screen becomes the command prompt window.
93d5bf32 88.PP
e4414eae
EW
89There are two types of commands. Short commands are
90usually one or two key strokes. Long commands are entered
91in the command window and terminated with carriage return
92or line feed (see the ``:'' command below). They consist
93of words separated by spaces or tabs. Words can be quoted
94to include the spacing characters. The ``\\'' convention
95of \fIC\fP applies. Alternately, long commands can be read
96in from files and executed (see \fIsource\fP below).
97.PP
98The short commands are
93d5bf32
EW
99.TP
100.B [1-9]
f85ea165
EW
101Select window \fI[1-9]\fP as the current window
102and return to conversation mode.
93d5bf32
EW
103.TP
104.B %[1-9]
f85ea165 105Select window \fI[1-9]\fP but stay in command mode.
93d5bf32
EW
106.TP
107.B ?
108List a short summary of commands.
109.TP
f85ea165
EW
110.B ^L
111Redraw the screen.
112.TP
93d5bf32
EW
113.B escape
114Return to conversation mode.
115.TP
116.B ^P
117Return to conversation mode and write ^P to the
118current window. Thus, typing two ^P's in conversation
119mode sends one to the current window. If the \fIwindow\fP
120escape is changed to some other character, that
f85ea165 121character takes the place of ^P here.
93d5bf32 122.TP
f85ea165
EW
123.B q
124Exit \fIwindow\fP. Confirmation is requested.
93d5bf32 125.TP
05631f05
EW
126.B ^Z
127Suspend \fIwindow\fP.
128.TP
93d5bf32 129.B w
f85ea165
EW
130Create a new window. You are prompted for the positions
131of the upper left and lower right corners of the window.
e4414eae
EW
132The cursor is placed on the screen and the keys ``h'', ``j'',
133``k'', and ``l''
134move the cursor left, down, up, and right, respectively.
135The keys ``H'', ``J'', ``K'', and ``L'' move the cursor to the respective
05631f05 136limits of the screen. Typing a number before the movement keys
f85ea165 137repeats the movement that number of times.
e4414eae 138Return enters the cursor position
93d5bf32
EW
139as the upper left corner of the window. The lower right corner
140is entered in the same manner. Typing escape (or ^[) at any
e4414eae 141point cancels this command.
93d5bf32 142.IP
05631f05 143This window becomes the current window,
430fecd4
EW
144and is given the first available label. The default buffer size
145is used (see \fIbuffer\fP command below).
146The
93d5bf32
EW
147.TP
148.B c[1-9]
05631f05 149Close window \fI[1-9]\fP. The process in the window is sent
f85ea165 150the hangup signal (see \fIkill (1)\fP). \fICsh (1)\fP should
93d5bf32
EW
151handle this signal correctly and cause no problems.
152.TP
153.B C
93d5bf32
EW
154Close all windows.
155.TP
f85ea165 156.B S
93d5bf32
EW
157Show all windows. Each window is brought to the top in sequence,
158with the terminal cursor placed on its label. Typing escape
e4414eae
EW
159at this point will select the displayed window as the current window.
160Return will display the next one. This command is useful
93d5bf32 161when there are a large number of windows and some are completely
f85ea165 162hidden by others.
93d5bf32 163.TP
05631f05
EW
164.B L
165List all windows. A special window is opened and all user windows are
166listed in it with their labels.
167.TP
168.B ^Y
169Scroll the current window up by one line.
170.TP
171.B ^E
172Scroll the current window down by one line.
173.TP
93d5bf32
EW
174.B ^U
175Scroll the current window up by half the window size.
176.TP
177.B ^D
178Scroll the current window down by half the window size.
179.TP
180.B ^B
181Scroll the current window up by the full window size.
182.TP
183.B ^F
184Scroll the current window down by the full window size.
185.TP
186.B h
187Move the cursor of the current window left by one column.
188.TP
189.B j
190Move the cursor of the current window down by one line.
191.TP
192.B k
193Move the cursor of the current window up by one line.
194.TP
195.B l
196Move the cursor of the current window right by one column.
197.TP
f85ea165
EW
198.B :
199Enter a long command.
200.PP
e4414eae 201The long commands:
f85ea165
EW
202.TP
203.B escape C
204Set the escape character to \fIC\fP.
205.TP
206.B terse [off]
207Turn on (or off) terse mode. In terse mode, the command window
208stays hidden even in command mode, and errors are reported by
209sounding the terminal's bell.
210.TP
430fecd4 211.B window row col nrow ncol [nline]
f85ea165 212Open a window with upper left corner at \fIrow\fP, \fIcol\fP
430fecd4
EW
213and size \fInrow\fP, \fIncol\fP. If \fInline\fP is specified,
214then that many lines is allocated for the text buffer. Otherwise,
215the default buffer size is used. Using a \fB``*''\fP in place of
216\fIrow\fP, \fIcol\fP, \fInrow\fP, or \fIncol\fP gives, respectively,
217the up, left, down, or right extremes of the screen.
218.TP
219.B buffer nline
220Set the default buffer size to \fInline\fP. Initially, it is
22148 lines. Using a very large buffer can slow the program down
222considerably.
f85ea165
EW
223.TP
224.B label [1-9] string
05631f05 225Label window \fI[1-9]\fP with \fIstring\fP. This is in addition
e4414eae 226to the numeric label that is always displayed.
f85ea165
EW
227.TP
228.B %[1-9]
229Make window \fI[1-9]\fP the current window.
230.TP
05631f05
EW
231.B write [1-9] string
232Write \fIstring\fP to window \fI[1-9]\fP.
233.TP
234.B close [1-9] ...
235Close window \fI[1-9]\fP. More than one window can be specified.
236If no window is given, then all windows are closed.
237.TP
f85ea165 238.B source file
e4414eae 239Read and execute the long commands in \fIfile\fP. Recursive
f85ea165 240\fIsource\fP is not allowed.
93d5bf32
EW
241.SH FILES
242.ta 15
f85ea165
EW
243~/.windowrc startup command file.
244.br
93d5bf32 245/dev/ptyp? pseudo-terminal devices.
93d5bf32
EW
246.SH DIAGNOSTICS
247Should be self explanatory.
248.SH BUGS
249When all pseudo-terminal devices are used, the \fB``w''\fP
f85ea165 250command fails mysteriously.
93d5bf32
EW
251.PP
252When a window is scrolled or the cursor moved, output from
253the process in the window will be displayed at the new cursor
254position. This is consistent with real terminals but
255not always desirable.