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