new version number
[unix-history] / usr / src / usr.bin / window / window.1
.\" @(#)window.1 3.1 83/08/09
.TH WINDOW 1 local
.SH NAME
window \- multiple window shell
.SH SYNOPSIS
window
.SH DESCRIPTION
\fIWindow\fP provides a window oriented working environment
on ordinary CRT terminals.
.PP
Windows are rectangular partitions on the physical terminal screen
that are indistinguishable from real terminals to processes running in
them. Their sizes and placement are determined at creation
time. They are framed as necessary to mark the boundaries between
windows. Each window, like terminals, has a cursor and a set of
control functions. Most intelligent terminal functions such as line and
character deletion and insertion are supported. A \fItermcap (5)\fP
entry tailored to each window is passed on to its processes
in the environment (see \fIenviron (8)\fP). A pseudo-terminal
device (\fIpty (4)\fP) is allocated for each window. This becomes
the standard input, output, and diagnostic output of the processes.
Initially a shell, usually \fIcsh (1)\fP, is placed in the window.
.PP
Windows are labeled with the digits ``1'' through ``9'',
thus a maximum of nine windows are supported.
One window, the current window, is treated specially.
This window is indicated by displaying its label in reverse video.
.PP
Windows can overlap. Some can be completely obscured by others.
The current window is always on top of all others.
.PP
The \fIwindow\fP program has two functional modes: command mode
and conversation mode.
In conversation mode, the terminal's
real cursor is placed at the cursor position of the current
window and all keyboard input is sent to the process in that
window. Output from windows is displayed at all times,
even in command mode.
Typing \fIwindow\fP's escape character (normally ^P)
in conversation mode switches \fIwindow\fP into
command mode. In command mode, the top line of the
terminal screen becomes the command prompt window,
and the cursor in the current window is replaced by a
blinking reverse video block (if these functions are supported
by the terminal).
.PP
There are two types of commands. Short commands are
usually one or two key strokes. Long commands are entered
in the command window and terminated with carriage return
or line feed (see the ``:'' command below). They consist
of words separated by spaces or tabs. Words can be quoted
to include the spacing characters. The ``\\'' convention
of \fIC\fP applies. Alternately, long commands can be read
in from files and executed (see \fIsource\fP below).
.PP
The short commands are
.TP
.B [1-9]
Select window \fI[1-9]\fP as the current window
and return to conversation mode.
.TP
.B %[1-9]
Select window \fI[1-9]\fP but stay in command mode.
.TP
.B ?
List a short summary of commands.
.TP
.B ^L
Redraw the screen.
.TP
.B escape
Return to conversation mode.
.TP
.B ^P
Return to conversation mode and write ^P to the
current window. Thus, typing two ^P's in conversation
mode sends one to the current window. If the \fIwindow\fP
escape is changed to some other character, that
character takes the place of ^P here.
.TP
.B q
Exit \fIwindow\fP. Confirmation is requested.
.TP
.B w
Create a new window. You are prompted for the positions
of the upper left and lower right corners of the window.
The cursor is placed on the screen and the keys ``h'', ``j'',
``k'', and ``l''
move the cursor left, down, up, and right, respectively.
The keys ``H'', ``J'', ``K'', and ``L'' move the cursor to the respective
limits of the screen. Number before the movement keys
repeats the movement that number of times.
Return enters the cursor position
as the upper left corner of the window. The lower right corner
is entered in the same manner. Typing escape (or ^[) at any
point cancels this command.
.IP
The environment variable SHELL is checked to find the
name of the shell program to place in the window.
\fICsh\fP (1) is used by default.
.IP
This window is given the first available label.
.TP
.B c[1-9]
Close the window \fI[1-9]\fP. The process in the window is sent
the hangup signal (see \fIkill (1)\fP). \fICsh (1)\fP should
handle this signal correctly and cause no problems.
.TP
.B C
Close all windows.
.TP
.B S
Show all windows. Each window is brought to the top in sequence,
with the terminal cursor placed on its label. Typing escape
at this point will select the displayed window as the current window.
Return will display the next one. This command is useful
when there are a large number of windows and some are completely
hidden by others.
.TP
.B ^U
Scroll the current window up by half the window size.
.TP
.B ^D
Scroll the current window down by half the window size.
.TP
.B ^B
Scroll the current window up by the full window size.
.TP
.B ^F
Scroll the current window down by the full window size.
.TP
.B h
Move the cursor of the current window left by one column.
.TP
.B j
Move the cursor of the current window down by one line.
.TP
.B k
Move the cursor of the current window up by one line.
.TP
.B l
Move the cursor of the current window right by one column.
.TP
.B :
Enter a long command.
.PP
The long commands:
.TP
.B escape C
Set the escape character to \fIC\fP.
.TP
.B terse [off]
Turn on (or off) terse mode. In terse mode, the command window
stays hidden even in command mode, and errors are reported by
sounding the terminal's bell.
.TP
.B window row col nrow ncol
Open a window with upper left corner at \fIrow\fP, \fIcol\fP
and size \fInrow\fP, \fIncol\fP.
.TP
.B label [1-9] string
Label the window \fI[1-9]\fP with \fIstring\fP. This is in addition
to the numeric label that is always displayed.
.TP
.B %[1-9]
Make window \fI[1-9]\fP the current window.
.TP
.B source file
Read and execute the long commands in \fIfile\fP. Recursive
\fIsource\fP is not allowed.
.PP
When \fIwindow\fP starts up, the file \fI.windowrc\fP in the
user's home directory is checked. If it exists, then the
commands contained in it are executed (using \fIsource\fP).
If \fI.windowrc\fP does not exist, then two
equal sized windows are created by default.
.SH FILES
.ta 15
~/.windowrc startup command file.
.br
/dev/ptyp? pseudo-terminal devices.
.SH DIAGNOSTICS
Should be self explanatory.
.SH BUGS
When all pseudo-terminal devices are used, the \fB``w''\fP
command fails mysteriously.
.PP
When a window is scrolled or the cursor moved, output from
the process in the window will be displayed at the new cursor
position. This is consistent with real terminals but
not always desirable.