xref: /original-bsd/usr.bin/window/window.1 (revision c43e4352)
@(#)window.1 1.3 83/08/02
WINDOW 1 local
NAME
window - multiple window shell
SYNOPSIS
window
DESCRIPTION
Window provides a window oriented working environment on ordinary CRT terminals.

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 termcap (5) entry tailored to each window is passed on to its processes in the environment (see environ (8)). A pseudo-terminal device (pty (4)) is allocated for each window. This becomes the standard input, output, and diagnostic output of the processes. Initially a shell, usually csh (1), is placed in the window.

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.

Windows can overlap. Some can be completely obscured by others. The current window is alway on top of all others.

The window 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 window's escape character (normally ^P) in conversation mode switches window 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).

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 C applies. Alternately, long commands can be read in from files and executed (see source below).

The short commands are

[1-9] Select window [1-9] as the current window and return to conversation mode.

%[1-9] Select window [1-9] but stay in command mode.

? List a short summary of commands.

^L Redraw the screen.

escape Return to conversation mode.

^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 window escape is changed to some other character, that character takes the place of ^P here.

q Exit window. Confirmation is requested.

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.

The environment variable SHELL is checked to find the name of the shell program to place in the window. Csh (1) is used by default.
This window is given the first available label.

c[1-9] Close the window [1-9]. The process in the window is sent the hangup signal (see kill (1)). Csh (1) should handle this signal correctly and cause no problems.

C Close all windows.

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.

^U Scroll the current window up by half the window size.

^D Scroll the current window down by half the window size.

^B Scroll the current window up by the full window size.

^F Scroll the current window down by the full window size.

h Move the cursor of the current window left by one column.

j Move the cursor of the current window down by one line.

k Move the cursor of the current window up by one line.

l Move the cursor of the current window right by one column.

: Enter a long command.

The long commands:

escape C Set the escape character to C.

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.

window row col nrow ncol Open a window with upper left corner at row, col and size nrow, ncol.

label [1-9] string Label the window [1-9] with string. This is in addition to the numeric label that is always displayed.

%[1-9] Make window [1-9] the current window.

source file Read and execute the long commands in file. Recursive source is not allowed.

When window starts up, the file .windowrc in the user's home directory is checked. If it exists, then the commands contained in it are executed (using source). If .windowrc does not exist, then two equal sized windows are created by default.

FILES
~/.windowrc startup command file.

/dev/ptyp? pseudo-terminal devices.

DIAGNOSTICS
Should be self explanatory.
BUGS
When all pseudo-terminal devices are used, the ``w'' command fails mysteriously.

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.