WIND(1) MachTen Programmer’s Manual WIND(1)

NAME
wind - the MachTen windows environment

SYNOPSIS
wind

DESCRIPTION
The MachTen windows environment allows you to have many
virtual terminal UNIX shell sessions within Macintosh win-
dows. It provides standard Macintosh menus and keyboard
shortcuts to create terminal emulator windows and control
the size, ordering, placement and per-window characteris-
tics of those windows. The windows system provides a
VT100 terminal emulation within each window, creating a
shell and environment similar to that created by the login
program.

Executing the wind daemon starts up the MachTen windows
environment. By default, wind is started automatically
when the user signs on the Login Console via the user’s
.login file (csh) or .profile file (sh). If there is a
file named .windrc in the home directory, the specifica-
tion of the user’s window environment is taken from that
file. Otherwise, a single 24 row by 80 column window is
opened and the default font and font size are set to
Monaco 9 point (or the closest available "real" fixed
width font and size).

See LAUNCHING WINDOWS below for details of menu creation
and the format of the .windrc file.

USAGE
MachTen Windows
The MachTen windows environment is a menu-oriented system
providing the user with the capability to create and con-
trol multiple terminal emulator windows. It follows as
closely as possible the Macintosh user interface standard.

Each window is a Macintosh "zoom window" with the follow-
ing window elements:

o A title bar across the top. Clicking and dragging the
mouse in the title bar allows you to move the window
around on the desktop.

o A scroll bar on the right-hand side provides the abil-
ity to view text that has scrolled off the top of the
virtual terminal.

o A zoom box in the upper right-hand corner. Clicking
in this box by placing the mouse cursor over the zoom
box and depressing the mouse button makes the window
fill the entire screen. The next click in the zoom
box causes the window to go back to its previous size.

o A size box in the lower right-hand corner. Clicking
and dragging this box allows you to resize the screen.

o A close box in the upper left-hand corner. Clicking
in this box closes the window and kills any processes
associated with the window.

Input to Windows
Keyboard input is always directed to the active window.
You can choose the active window in a number of ways,
either through the Window menu, through the keyboard
shortcut Command-# , where # corresponds to the number of
the terminal desired, or by clicking the mouse inside the
desired window.

Menus
MachTen Windows menus are located at the top of the
screen. In keeping with the UNIX keyboard orientation,
most menu items also provide keyboard shortcuts (Com-
mand-key combinations).

Menus are invoked by positioning the mouse cursor over the
menu name and holding down the mouse button. The complete
menu appears at this time and the desired menu item is
selected by sliding the mouse cursor down to that item and
releasing the mouse button.

If the menu item has a keyboard shortcut, the identical
action can be taken by either selecting the item with the
mouse or by typing Command-key.

The Apple Menu
This menu provides the MachTen "splash" and whatever Desk
Accessories or Apple Menu items are installed on the run-
ning system.

o About MachTen - information on how to contact Tenon

The File Menu
This menu opens and closes terminal windows and disables
the window environment.

o Create Window Command-N - create a new terminal win-
dow.

o Close Window Command-W - close the active terminal
window.

o Logout Command-Q - log out of the MachTen windows
environment, closing all existing windows, shells and
sub-processes. Return to the minimal "Login Console"
environment.

The Edit Menu
This menu provides you with access to the Macintosh Clip-
board. Text can be selected by moving the mouse cursor to
the start/end of the selection and holding the button down
while moving forward/backward to the end point of your
selection and releasing the mouse button. Selected text
is displayed as white letters on a black background. Dou-
ble-clicking the mouse selects the word where the mouse
cursor is, while triple-clicking selects the complete
line.

o Undo Command-U - has no function on MachTen windows
and is provided only to support desk accessories.

o Cut Command-X - has no function on MachTen windows and
is provided only to support desk accessories. The
concept of cutting from text in a terminal window is
not meaningful, since this text is merely a history of
output to the virtual terminal device. Moreover, spe-
cific applications need built-in "Cut" support. In
MachTen, traditional Macintosh "Cut and Paste" func-
tions are supported by "Copy and Paste".

o Copy Command-C - puts a copy of the selection on the
Clipboard.

o Paste Command-V - puts a copy of the contents of the
Clipboard as input to the active window. Continues to
paste copies until a new selection is copied.

o Clear - has no function on MachTen windows and is pro-
vided only to support desk accessories.

o Select All Command-A - Select all text in the active
window.

o [Copy,] Paste, <cr> Command-G - If there is a current
selection it is copied to the Clipboard. The Clip-
board is then provided as input to the active window,
followed by a <cr>. This provides you with the abil-
ity to select something on the screen and turn it into
(the tail end of) a UNIX command.

o Save Selection - save the selected text to a file.

The Window Menu
This menu consists of three sections. The first section
consists of three permanent items that are hierarchical
menus. To access the hierarchical menus slide the mouse
cursor over the item and to the right, which will make
their sub-menus visible.

o The Positions Sub-Menu - consisting of:

o Windowpanes Command-P - position windows so that
they are all visible on the screen, creating a win-
dowpane effect.

o Horizontal Panes - windowpane effect with each win-
dow as wide as the complete screen.

o Vertical Panes - windowpane effect with each window
as tall as the complete screen.

o Original Positions - undo the windowpane effect.

o The Size Sub-Menu - consisting of:

o Original Size Command-O - return the active window
to the size it was when it was opened.

o Full Height Command-F - make the active window as
tall as will fit on the screen. This command is a
toggle command - if the active window is tall, it
will return to its previous size.

o Zoom Window Command-B - make the active window as
big as will fit on the screen. This command is a
toggle command - if the active window is tall, it
will return to its previous size. The results of
this command are identical to clicking in the zoom
box of the active window.

o The Order Sub-Menu - consisting of:

o Hide Active Window Command-H - makes the active win-
dow invisible. A hidden window can be made visible
using the show all command, or by selecting that
window (See DESCRIPTION above).

o Hide All Command-D - make all windows invisible.

o Show All Command-K - make all windows visible.

o Last Window Command-L - make the previously active
window the current active window.

o Rotate Windows Command-R - make the current rear
window (furthest from front on the desktop) the
front and active, and make the active window the
second window.

The second section consists of individual menu items that
control the window appearance.

o Save Scrolled Lines - if Save Scrolled is selected for
a given window, the lines scrolled off the top of the
window will be saved and the scroll bar will be acti-
vated. The window will remain in this state until
Dont’t Save Scrolled Lines is selected. These two
commands share one line in the Window menu; when Save
Scrolled is enabled; the menu says Don’t Save, and
vice versa.

o Remove Scrolled Lines - If Save Scroll is enabled for
a window, this will throw away any saved lines.

o Save Window Environment.. - save a description of the
size and locations of the current windows to the named
file. The font type and size of the active window are
specified as the defaults. By default, the environ-
ment will be saved to the .windrc file in the user’s
home directory.

o Send Window Size Command-S - provides the string "stty
rows n columns m" as input to the active window, where
n is the number of rows that will fit in that window
using the current font type and size, and m is the
number of columns. This is useful when accessing UNIX
systems over the network that want to know the size of
the terminal. An example would be using the telnet
program to access a Sun Workstation, and trying to run
some screen-oriented program such as vi(1) on the
remote system. After connecting to the remote system,
the "Send stty command" will inform the remote system
the terminal size to use.

The third section of items in the Window menu consists of
the names of the existing terminal windows. The item with
a check mark is the window that is the current console
window. The active window is displayed in outline font.
The keyboard shortcuts for these items are Command-# ,
where # is the number of the terminal window.

The Fonts Menu
This menu is created at startup time and contains all
fixed width fonts found in the current system, with point
size choices of 9, 10, 12, 14, 18, 24 and 36. The current
font item of the active window is checked, and the font
sizes of "real" fonts are displayed in outline font. Real
fonts are non-scaled fonts and will tend to look much
nicer.

Some commonly found fixed width fonts are Courier and
Monaco.

SPECIAL FEATURES
Font sizes can be changed to the next size larger/smaller
using Command-up-arrow and Command-down-arrow.

Support for the Macintosh Plus keyboard (which does not
include a <control> key or an <escape> key) is provided.
On the Macintosh Plus keyboard, the <option> key is inter-
preted as a <control> key and the <clear> key is inter-
preted as an <escape> key. Alternatively, an <escape> key
can be generated using the <option>-[ keys.

LAUNCHING WINDOWS
At start-up, the wind daemon creates the Font menu as
described above in the Font menu section. When the win-
dows environment is entered by running /usr/etc/wind, the
system looks in your home directory for a file named .win-
drc, which contains the specification of the your pre-
ferred windows environment. Otherwise, a single 24 row by
80 column window is opened and the default font and font
size are set to Monaco 9 point (or the closest available
"real" fixed width font and size).

The .windrc File
The easiest way to create a .windrc file is to create all
of the windows that you want to have as your standard
startup environment, position them as desired, and set the
active window’s font type and point size to the font that
you would like all of the automatically started windows to
use. Then select the "Save Window Environment" item in
the File menu. You will be asked to provide a filename
for the save; by default the .windrc file in your login
home directory. It’s a good idea to keep a copy of your
currently running .windrc file.

To change the names of the terminal windows, edit the
.windrc file and change the name from "Terminal n" to
whatever you would like.

If you want any terminal window to run an alternative pro-
gram instead of the shell specified in your /etc/passwd
entry, simply follow the window name with a -command,
where command is any legal program name and parameters.
That terminal will run the command specified. Note, how-
ever, that when that command terminates, the terminal win-
dow will close automatically. Useful commands to use here
are interactive programs such as rlogin <hostname> or vi
<filename>. (A complete pathname is necessary.)

The .windrc file is made up of records as follows:

f <font_num font_size>
S
C<y|n> <action>
w <l.h l.v r.h r.v> <name> [-command [parameter string]]

The f record specifies the default font type and size.

<font_num> is the number of the default font style. Font
numbers are assigned by Apple. The font number of Courier
is 22 and Monaco is 4.

The S record sets the default window action to Save
Scrolled Lines. This default is the same as selecting
Save Scrolled Lines in the Window menu. In the absence of
this record, new windows don’t have Save Scrolled Lines
selected.

The C record specifies whether or not to present a dialog
box to confirm a significant action; Cy requests confirma-
tion, Cn does not. The list of confirmable actions and
their defaults follows:

CloseWindow closing a window via the File menu
(or hot key Command-W); default Cn.

Logout logging out via the File menu (or
hot key Command-Q); default Cy.

The w record specifies the size, position, name and,
optionally, the command run in the terminal window. If no
command is provided, the shell specified in the
/etc/passwd file is the command executed.

The window size and location record object <l.h l.v r.h
r.v> is coordinate pair specifications of the upper left
and lower right corners of the window or icon. This can
be determined by experimentation, or by creating a window
of the desired size and position and then using the "Save
Window Environment" Window menu item.

<name> is the name of the window, and will be displayed in
the window’s title bar and in the Window menu. The name
is truncated at 16 characters long.

ENVIRONMENT
The user’s environment includes the TERM and TERMCAP envi-
ronment variables set by the wind daemon. It is important
that these remain set to proper values or undesirable
functioning of the VT100 emulation within your terminal
windows may result.

The environment variable WIND_NAME is also defined so that
any program that would like to recognize the MachTen win-
dows environment can check for this.

FILES
~/.windrc
/usr/etc/wind
/dev/win[abc][1-f]
/dev/ptypf
/dev/ttypf
/etc/passwd
/etc/utmp
/usr/adm/wtmp

SEE ALSO
passwd(5)

BUGS
The font_num object in the .windrc file should be speci-
fied by name, not by number.

MachTen 17 June 1993 6