8½(4) 8½(4)
NAME
8½ - window system files
SYNOPSIS
8½ [ -i 'cmd' ] [ -s ] [ -f font ]
DESCRIPTION
The window system 8½ serves a variety of files for reading,
writing, and controlling windows. Some of them are virtual
versions of system files for dealing with the display, key-
board, and mouse; others control operations of the window
system itself. 8½ posts its service in the /srv directory,
using a name constructed from a catenation of the user ID
and a process id; the environment variable $8½srv is set to
this service name within processes running under the control
of each invocation of 8½.
A mount (see bind(1)) of that file causes 8½ to create a new
window; the attach specifier in the mount gives the coordi-
nates of the created window. The syntax of the specifier is
N pid minx miny maxx maxy
where pid is the process id of a process in the note group
(see fork(2)) to receive interrupt and hangup notes in that
window. The list of coordinates may be separated by blanks
or commas.
When a window is created either by the window command (see
8½(1)) or by using the menu supplied by 8½, this server is
mounted on /mnt/8½ and also /dev; the files mentioned here
appear in both those directories.
Some of these files supply virtual versions of services
available from the underlying environment, in particular the
character terminal files cons(3), and all the bit devices
bit(3), each specific to the window. Other files are unique
to 8½.
bitblt
is a virtual version of the bitblt file within the cur-
rent window; see bit(3), graphics(2). All operations
are clipped to the current window. The coordinate sys-
tem is absolute; it refers to the real screen.
cons is a virtual version of the standard terminal file
cons(3). 8½ supplies extra editing features and a
scroll bar (see 8½(1)).
consctl
Page 1 Plan 9 (printed 11/7/25)
8½(4) 8½(4)
controls interpretation of keyboard input. Writing
strings on it sets these modes: rawon turns on raw
mode; rawoff turns off raw mode; holdon turns on hold
mode; holdoff turns off hold mode. Closing the file
makes the window revert to default state (raw off, hold
off).
kbd This file intercepts the path between the keyboard and
cons. Reading from it gathers characters typed towards
the associated window; writing to it inserts characters
into the input stream of that window.
label
initially contains a string with the process ID of the
lead process in the window and the command being exe-
cuted there. It may be written and is used as a tag
when the window is hidden.
mouse
is a virtual version of the standard mouse file (see
bit(3)). Opening it turns off scrolling, editing, and
8½-supplied menus in the associated window. The 0x80
bit in the buttons byte of a returned record indicates
that the window has been reshaped. Reading this file
blocks until the mouse moves or a button changes.
Mouse movements or button changes are invisible when
the mouse cursor is located outside the window.
nbmouse
is a non-blocking version of mouse; it always returns
the current state. Its use is discouraged.
select
returns the selected text in the designated window. It
may not be written.
snarf
returns the string currently in the snarf buffer.
Writing this file sets the contents of the snarf
buffer.
text returns the full contents of the window. It may not be
written.
winid
returns the unique and unchangeable ID for the window;
it is a string of digits.
window
is the virtual version of /dev/screen; see bit(3). It
contains the depth, coordinates, and bitmap correspond-
ing to the associated window.
Page 2 Plan 9 (printed 11/7/25)
8½(4) 8½(4)
windows
is a directory containing a subdirectory for each win-
dow, named by the unique ID for that window. Within
each subdirectory are entries corresponding to several
of the special files associated with that window:
bitblt, cons, consctl, label, etc.
EXAMPLES
Cause a window to be created in the upper left corner, and
the word `hi' to be printed there.
mount $8½srv /tmp N$pid' 0 0 128 64'
echo hi > /tmp/cons
Print the bitmap of window number 123.
lp /dev/windows/123/window
SOURCE
/sys/src/cmd/8½
SEE ALSO
8½(1), bit(3), cons(3), event(2), graphics(2).
Page 3 Plan 9 (printed 11/7/25)