Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ (1) — Plan9 3rd Edition (Vita Nuova)

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sh(1)

mash(1)

wm(1)

plumber(8)

WM-SH(1)

NAME

sh, mash − Window frames for the Inferno shells

SYNOPSIS

­wm/sh ­sh-args
­wm/mash ­mash-args

DESCRIPTION

Both ­wm/sh and ­wm/mash provide a graphical framework to their respective shells.  Both wrappers manage the input and output of the shell.  They provide facilities for scrolling and editing the output buffer and for constructing input to be sent to the shell. 

­Wm/sh invokes the shell sh(1) with the arguments ­-n sh-args; ­wm/mash invokes mash(1) with the arguments mash-args.

­Wm/sh and ­wm/mash both provide their own versions of ­/dev/cons and ­/dev/consctl files in the namespace of the invoked shell (see cons(3) for the originals) and attach the standard input of the invoked shell to the virtualised ­/dev/cons file.  Output from the shell, or of any commands run by the shell, is displayed in a scrollable text window, appearing at the output position, which is at the end of any previously output text, before any as-yet-unread user input text.

Any text displayed on the console can be edited.  Typed text is always inserted at the position of the input cursor.  The input cursor can be moved to any point in the text by clicking mouse button-1 at the desired position.  Selections can be made by dragging the mouse with button-1 held down.  Typing into a selection copies its text to the Snarf buffer, the selected text is deleted and the typed character inserted. 

Text typed beyond the output point will be made available to commands reading from /dev/cons.  Normally this text is made available when newline is typed, but typing ESC turns on ­hold mode (the text turns blue), deferring the availability of the text until ESC is typed again, turning hold mode off. This allows simple multi-line editing of the standard input to a command. 

Writing ­rawon to ­/dev/consctl changes the above behaviour, making each character typed beyond the output point available to commands as soon as it is typed; the character is not automatically echoed. Writing ­rawoff to ­/dev/consctl reverses this behaviour. 

In addition to dragging out selections, they can be made by double clicking mouse button-1.  Double clicking over a word selects the whole word.  Double clicking next to a brace or bracket selects the text between it and its matching brace or bracket.  If there is no match then no selection is made. 

Clicking mouse button-2 displays a pop-up menu of editing commands:

­Cut Copy the current selection to the Snarf buffer and then delete the selected text.  This command has no effect if there is no selected text, the Snarf buffer is not cleared. 

­Paste
When there is no text selected, the contents of the Snarf buffer are inserted at the current input cursor. If a selection exits, its text is replaced by that of the Snarf buffer. The new text is then selected. The contents of the Snarf buffer remain unaltered.

­Snarf
Copy the selected text to the Snarf buffer. This command has no effect if there is no selected text.

­Send If there is any text selected it is copied to the Snarf buffer.  The contents of the Snarf buffer is then appended to the end of the current shell input line, forwarding any NewLine completed lines to the shell’s input stream. 

Mouse chording is implemented as in acme(1). Dragging a selection with button-1 held down and then also clicking button-2 cuts the selected text into the Snarf buffer. Clicking button-3 instead of button-2 replaces the selected text with the contents of the Snarf buffer.

Clicking mouse button-3 plumbs the word or selection under the click point.  See plumber(8) for more information on plumbing.

PLUMBING

Both ­wm/sh and ­wm/mash plumb text selected by button 3; an empty selection plumbs the white-space bounded text surrounding the selection. 

SOURCE

­/appl/wm/sh.b
­/appl/wm/mash.b

SEE ALSO

sh(1), mash(1), wm(1), plumber(8)

Plan 9  —  June 29, 2000

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026