macintosh@felix.UUCP (03/23/87)
[dumb virtue: on-line documnentation] Note that to put the documentation into Mac format again you should pipe it through "crstrip" into a dv window and then save it on your Mac. Thanks, Kevin Eric Saunders ARPA: saunders@tcgould.tn.cornell.edu uw-beaver!cornell!batcomputer!saunders --- "dumb virtue" v1.1 on-line documentation (copyright Kevin Eric Saunders 1987) How to use this command index: select the command name with the mouse and use "Find selection" (Command-/) to find entries. >About >Anchor >Blank >Cancel >Capture >Copy >CR >Cut >Delete >Down >dv >desk >Edit >Find >Get >Find >Free >Input >Key->Menu >Left >Line >Literal >Manual >Option >Output >Page >Paste >Print >Prompt >Record >Reformat >Reset >New >Right >Save >Scroll >Select >Select all >Sentence >Set >Shift >Tag >Tek >Terminal >Undo >UNIX >UpFront >Up >Word wrap >XON-XOFF >Yank Index 1: Introduction 1.1: Description 1.2: The keyboard 1.3: Window manipulation 1.4: Text windows 2: Menu commands 2.1: Apple 2.2: File 2.3: Edit 2.4: Cursor 2.5: Window 2.6: Echo 2.7: Comm 2.8: Fonts 2.9: Size 2.10: Top 3: Some details 3.1: ANSI terminal emulator 3.2: File uploading with UNIX 3.3: File uploading with other systems 3.4: Help files 3.5: Recommended settings 4: BUGS 1: Introduction About this text: all bracketed text [ ... ] refers to features of the program not yet implemented; the word WARNING is used to highlight dangerous operations throughout this document; and the "selection point" for text is referred to as the "cursor" throughout this document. There are several deviations from the Macintosh "holy writ" in the program interface, which are labelled "DEV" in this text. (Macintosh interface chauvinists may address their complaints to /dev/null; this program was designed to be used, not worshipped.) 1.1: Description "dumb virtue" is a program for the Macintosh providing multi-window text- editing and single-window terminal emulation. It supports the association of terminal input and output with different text windows, and the editing of local text window contents using both the standard Macintosh mouse-driven commands and a complement of cursor motion commands. Plain ASCII file transmission can be performed with hosts using timed line sends or xon/off flow control. The program provides a window which executes a subset of the commands in the ANSI X3.64 (DEC VT100-like) terminal protocol so that large files on a remote host can be quickly and conveniently edited. This emulator can use any font (including variable width fonts) in any existing size, and runs at over 800 cps. [A window which can be used to draw graphics output for the Tektronix 4014 is also provided.] The cost of the license for each executable binary image of the program is $20, payable to databeast, PO Box 6855, Ithaca, NY 14851. You may possess and distribute non-executable images (e.g., a binhex'ed) of the program freely. For $10, licensed users can purchase a copy of the latest version of the program from the above address. 1.2: The keyboard The command (clover symbol) key is used to select menu items from the menus. To execute a menu command from the keyboard rather than with the mouse, simply press the command key with your thumb and press the other character listed in the menu at the same time. (Some items will metaphorically "use the end" if you hold down the Option key at the same time also.) The Key->Menu command (Command-Space) turns on a special mode, in which all keys pressed are interpreted as menu commands. When this mode is on, the menu bar is highlighted. When you are communicating with another computer and need to send control signals (e.g., Control-C, which is used on many systems to abort a command), pressing Option-character causes the corresponding ASCII control code to be sent (NOTE, however, that if you are in "Edit" mode, explained later, that the character will be incorporated into the text in the input window rather than being sent immediately!). 1.3: Window manipulation WARNING: Pressing the mouse button in a window's go-away box causes it (and any text in it) to be disposed of, unless the window is the Input, Output, or System window. (The Input and Output windows will remain unchanged, while the System window will go behind all the other windows when the go-away box is used.) 1.4: Text windows DEV: Striking a key when a selection exists does not delete the selection range. DEV: To select a range using the keyboard, one uses the Anchor and Select commands, rather than holding down the Option key while moving the cursor. 2: Menu commands The command names and command-key equivalents (in parentheses) are accompanied by a brief explanation of their function. If, when you attempt to execute a menu command using the mouse, the error message "out of RAM" appears, you should use the Free Memory command (Command--) to reorganize memory; if this does not free enough space, try eliminating some text or using smaller fonts. The menu formats are contained in MENU resources, so if you wish to modify the command keys, you can easily do so using ResEdit. DEV: the Menu Bar is used to present prompts. 2.1: Apple menu >About dumb virtue: This menu item contains useful information about this program and licensing provisions. >Free Memory (-): Prints the amount of memory free and then reorganizes memory so that space is used more efficiently (doing this twice will yield a larger but somewhat unrealistic free memory estimate). >Key->Menu (Spacebar): Places the keyboard in command mode, so that all keystrokes are interpreted as menu commands. The menu bar is inverted while this mode is in effect. 2.2: File menu This menu contains commands related to file access and printing. The file-related commands initiate dialogs based on the Macintosh Standard File dialogs. These commands operate on the contents of the front window, which must be a text window. >Get ... (G): Allows you to load a file from disk into the window. >Save ... (Z): Saves the contents of the window in a file. If the Option key is held down, they will be appended. >Save selection ...: Saves the current selection range in the front window in a file. If the Option key is held down, it will be appended. >Delete ...: Deletes the file you select. WARNING: It doesn't ask twice. >Print selection: This command will print the text selection in the front window. If no text is selected, the whole text is printed. It assumes that the printer is on the Printer Port if the Printer has not been set up using the Comm menu. WARNING: The print routine is not the Macintosh-standard print routine, so don't expect to be able to use a LaserWriter. The advantages to this approach are that this routine allows you to edit while printing, it is much faster when you are simply getting a hard copy of some text printed, and the printed text is properly spaced (unlike Macintosh Print Manager draft mode text). >New page: Sends a form feed to the printer to start a new page and resets the line count to 0. >Cancel Print: Cancels printing. >Reset printer: Sets the printer's left margin, tab locations, and Top of Form. Use this command before printing. (The commands sent to the printer assume you are using an Imagewriter. The paper should be positioned on the line where you wish to begin printing. If you are using a different brand of printer, you can initialize it by creating a file containing the escape sequences needed to set the margin, etc. Edit mode allows you to enter "non-printing characters" into a text window.) >Line spacing ...: Brings up a dialog which allows you to set the number of spaces between lines on a printout. >Manual feed: Causes the program to wait in between pages so you can insert a new one manually. >Capture ...: Allows you to save host output directly to disk. First a dialog appears which asks for the filename you want to use. After selecting the name, the program will wait until after you type the next line to start saving output. The host should send an ESCAPE () character to terminate the capture; the capture will terminate after about 30 seconds if no output ceases to arrive. >Cancel capture: Cancels the current file capture. >Send line (Shift-Enter): Pressing the Shift-Enter key combination sends the selected text in the current Input window to the host computer, wrapping around when the column exceeds the current Output Wrap setting (see explanation of Input window below). If no selection has been made, the program will send the host the contents of the current line to the right of the cursor WITHOUT wrapping it. Note that this command can be executed while the terminal window is in front. >Send all (Option-Enter): Pressing the Option-Enter key combination causes all the text in the Input window to be sent. >Cancel Send: Cancels transmission of text sent using Shift or Option Enter. >Save Configuration ...: Saves the serial port configuration, and the value of the options which are set in the "Echo" menu along with the "Manual feed" option. By modifying the 2nd and 3rd hexadecimal entries in the CONF 0 resource using ResEdit, you can configure the terminal window to be created with an arbitrary number of rows and columns (note that you need to inform the host of the values; see particularly ESC[!R in the section on the terminal). >Quit: Exits the program and returns to the Finder. 2.3: Edit menu These commands affect the front window. >Undo (Z): Undoes the last Cut, Copy, Paste, or Delete Right command. >Cut (X): Cuts the selected portion of text, keeping a copy in the dv Scrap. >Copy (C): Copies the selected portion of text into the dv Scrap. >Paste (V): Pastes the scrap into the text at the cursor; this replaces a selection range. >Clear: WARNING: Deletes the selected text without placing a copy in the Scrap. Useful when deleting large amounts of text on a 128K machine, when there may be too little memory to hold a copy. >Select all: Selects the entire text. >dv scrap->desk scrap: Copies the text last copied or cut into the Macintosh desk scrap so it can be used by another program. >desk scrap->dv scrap: Copies the current desk scrap into dumb virtue's text scrap. >Shift left: Shift the selected text to the left by deleting a tab character at the beginning of each line. >Shift right: Shifts the selected text to the right by inserting a tab at the beginning of each line. >Tag set ... (T): Saves the location of the selection range so you can go to that selection using the Yank command. After selecting this command, you must press a key from a-z which will associate that range with that character. >Yank tag ... (Y): Sets the selection range to the range associated with the key pressed, bringing the window to the front if necessary. If no tag is associated with that character, nothing happens. 2.4: Cursor menu All of the following commands affect the current Input window. These commands ordinarily use the beginning of the selection; if you hold down the Option key, they will move from (or show) the end of the selection. >Find cursor ('): Scrolls text in the window so that the cursor is visible. >Set cursor (;): Places the cursor in the middle of the window. >Left (H): Moves the cursor left one position. >Down (J): Moves the cursor down one line, where lines are separated by carriage returns. >Up (K): Moves the cursor up one line, where lines are separated by carriage returns. >Right (L): Moves the cursor right one position. >Delete Right (Backspace): Deletes the character (or selection plus one character) to the right of the cursor, placing a copy of this in the dv Scrap. Holding down the Option key makes it delete to the left. >Word left (,): Moves the cursor left one word in the text. (Words are delimited by ASCII characters less than 32 decimal.) >Word right (.): Moves the cursor right one word in the text. (Words are delimited by ASCII characters less than 32 decimal.) Holding the Option key down will move to the end of the word. >Sentence left ([): Moves the cursor left by a "sentence," which is loosely defined as either a Return, or a '.', '?', '!', ']', '"', or ')' followed one or more spaces. The Option key moves to the end of the previous sentence. >Sentence right (]): Moves the cursor right by a sentence using the same rule as the Sentence left command. The Option key moves to the end of the current sentence. >Page down (N): Pages down in the window without moving the cursor. >Page up (M): Pages up in the window without moving the cursor. >Match brackets (B): Selects the text within the bracket to the right of the cursor. You can customize this function by adding or deleting entries from the bracket-pair table in the BRCK resource. >Anchor (A): Sets one end of the selection range. >Select (S): Sets the other end of the selection range. 2.5: Window menu The windows, which are numbered from 0 to 9, are controlled by the Window menu. The four options at the top allow you to control the action taken when you select one of the windows. >UpFront (U): Selecting "Up front" will cause the next window selected to be made the front window. In the front window, you can select text with the mouse and use the commands in the Edit and Top menus. >Input (I): This window is marked with a '<' in the list of windows under the "Window" Menu. Setting "Input" on will cause any text window selected to be made the "Input window." In this window you can use the "Cursor" menu commands. NOTE: Typing only appears in the Input window when the "Edit" or "Record" options under the "Echo" menu are on. >Output (O): The current output window is marked with a '>'. Setting "Output" on will cause any text window selected to be made the "Output window." Characters received from a remote computer will appear in this window. (There are two modes of operation which directly affect this window, CR = CR-LF and Literal output, both under the "Echo" menu.) >Blank modes: This command causes the Up front, Input, and Output options to be set "off" for easier use of these commands from the keyboard. >0-9 (0-9): These items select one of the windows, setting it according to the Up front, Input, and Output options currently in force. Open: Serves only as a heading and does nothing. >Terminal (D): Selecting the "Terminal" option in the Windows menu brings forward a window which emulates an intelligent terminal. This window does not save text off the top, so it can be used to avoid filling up memory with text you don't want to save. The commands used are a subset of ANSI X3.64, which is similar to the command set for the DEC VT100; with most hosts, you should declare that you are using a VT100 or an ANSI terminal. A "termcap" [and a "terminfo"] entry describing its functions is provided for use with UNIX systems. [>Tek 4014: Emulates a Tektronix 4014 graphics display device.] >Scratchpad (`): Brings the Scratchpad window to the front, makes it the Input window, and turns off transmission to the host (i.e., "Edit locally" in the "Echo" menu is set on). If the Scratchpad is in front, it will be sent behind and the old communications parameters restored. 2.6: Echo menu >Record input (R): When you type into a text window and this mode is on, keystrokes other than ASCII control characters appear in the Input window. ASCII control characters are echoed immediately to the host. When the Return key is struck the line of text will be sent. >Edit locally (E): This mode has precedence over the "Record input" mode. When you type into a text window and this mode is on, all keystrokes (including ASCII control characters) appear in the Input window, but they are not echoed to the serial port. Note that if both Record and Edit modes are off, characters do not appear in the Input window, but are echoed to the host immediately. >Prompt skip (P): This mode exists so that a line sent when Record mode is on, and the Input window and Output window are the same, will NOT include a system prompt which has been incorporated in the current line of local text. The prompt MUST be followed by a space. >Break: This command sends a break to the remote system. >Option = Ctrl: When this mode is on, option-key combinations are interpreted as ASCII control characters. (Note that these are only incorporated into text when the Edit mode is on.) When "Option = Ctrl" is off, the option key makes the extended Apple character set. >Literal output: When this mode is on, all output from the host received on the modem port is added to the output window without interpretation of any sort. This mode is useful for analysing output from other devices when used in conjunction with an extended character set such as Mona, which allows you to see the non-printing characters. >Output wrap ...: Brings up a dialog box which allows you to set the column position at which wrapping of text sent to the modem or printer will occur. If you want no wrapping to occur, use 0. >BS = DEL: Causes a DEL (delete) character to be sent to the host computer when the Backspace key is struck. >CR = CR-LF: This command switches the interpretation of Carriage Return and Newline characters sent from the host, and causes dumb virtue to incorporate as much text as possible into the output window at once. This is useful in conjunction with certain terminal configuration options available on UNIX (the send newline only options--"stty nl" under 4.2 BSD, and similar options under SIII, SV, and their compatibles, such as XENIX); when CR = CR-LF is set and the proper terminal mode is selected, the speed of transmission into a text window increases from 290 cps to 752 cps. >UNIX windows: Sets up the program to function with John Bruner's uw program, which supports multiple virtual terminals under UNIX 4.2BSD. Using this option, you can run several programs simultaneously in separate windows so their output is not mixed up. NOTE: uw assumes it is dealing with an adm31-like terminal; you can deal with this by resetting the terminal type after starting it up. >Input lag ..., >Output lag ...: These options bring up a dialog box which allows you to set the length of time in ticks (60ths of a second) the program will wait to read input or write a line of output, respectively. The read lag helps make character drawing more efficient by allowing the program to wait until a whole line can be drawn at a time; the output lag helps allow the uploading of files to hosts which cannot handle rapid input. >Terminal wrap ...: Sets the number of pixels at which the terminal window will attempt to scroll, so the window can handle long lines. >XON-XOFF: Turns XON/XOFF (DC1/DC3) handshaking with the host on and off. 2.7: Comm menu >Modem/Printer: Selects the default port on which Comm menu item choices take effect. >Modem port, or >Printer port: Sets the port on which the device named above will be reading and writing, and on which the changes in the settings below will have their effect. On setting the modem configuration, the windows are rearranged and the "Echo" options are changed to the most useful configuration. >Baud: Sets the baud rate of the port. >Parity: Sets parity options for the port. >Stop Bits: Sets stop bit options for the port. >Data Bits: Sets the number of data bits expected by the port. 2.8: Fonts menu You can select any font available in your System file with this menu. If the font does not exist in the current size, you must select a new size before it will be displayed. 2.9: Size menu Using this menu you can select any real font size available for the current font. 2.10: Top menu Commands in this menu affect the front window. >Find selection (/): Finds a string of characters in the front window matching (literally) the characters in the current selection range. If no selection range is set, this command searches for the string used in the previous search. If no match is found, the selection range is set back to the cursor. You can also search backwards by pressing the Option key when you press Command-/. >Find ... (\): works like "Find selection", but instead prompts for a string, which is echoed as it is entered in the blanked-out Menu Bar. When you enter Return, the program will look for a match. (Tip: entering Command-C will abort the command.) >Go to line ... (=): Prompts for a line number and locates the cursor at the beginning of the line. Entering Return will take you to the end of the text. >Scroll: When scroll is on, the text in a window will move up when text is added and the cursor goes past the bottom. Turning off Scroll in the output window allows you to examine the output at your own speed with the scrollbars as text is added to the Output window. WARNING: don't move the cursor around! Remember, text gets added at the location of the cursor, not the end of text. >Word wrap: When word wrap is on, the text in a window will wrap around when the cursor goes past the right edge. >Label (TAB): Causes a label to be drawn in the front window's title bar, containing information on the state of the program: the number of the input window, a '>', the number of the output window, three labels "REP" to indicate whether Record, Edit, and Prompt modes are on, three labels "UIO" to indicate whether a window will be made the Up-front, Input, and/or Output window when selected using a menu-key combination, the length of the text in the front window, a '*' if that window has been modified, and a carriage return symbol if word wrap is off. >Reformat: This command reformats the text in the top window to fit into its current borders, and resets it to the top. 3: Some details 3.1: ANSI terminal emulator Following is a termcap file for Berkeley UNIX 4.2. If you wish to use a larger or smaller font for your display, you can make an entry for smaller screen sizes by duplicating the last five lines and changing instances of "24" to the number of lines which will fit. The standard font, Mona 9, fits in a dumv-28 frame. Monaco 9 also fits in a dumv-28 frame, while Geneva 9 fits in a dumv-26 frame, and most 12-point fonts fit in a dumv-20 frame. Mona 8, for those who like their text compact, fits in a dumv-30 frame. DV|dumv-unk|dumb virtue:\ :im=\E[4h:ei=\E[4l:mi:xn:\ :dc=\E[P:dl=\E[M:al=\E[L:\ :cr=^M:nl=^J:bl=^G:cl=\E[H\E[J:\ :bs:am:cm=\E[%i%d;%dH:up=\E[A:do=\E[B:le=^H:nd=\E[C:\ :ce=\E[K:cd=\E[J:\ :ho=\E[H:ta=^I:pt:sr=\EM:\ :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:\ :so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\ :cs=\E[%i%d;%dr: D5|dumv-24|dumb virtue:\ :is=\E[1;24r:\ :vs=\E[2J\E[1;24r:\ :co#80:li#24:tc=DV: 3.2: File uploading with UNIX In conjunction with the UNIX commands "stty tandem -echo" and "cat >filename", the Enter key send selection commands make it possible to upload a text selection to a UNIX file. The "stty tandem -echo" command tells the host: 1) to tell the Macintosh when it has temporarily run out of room for input; and 2) to stop sending your terminal an echo of your input, so that your output window is not stuffed with duplicated material. Inserting the text you wish to upload between "cat >filename" and a single Control-D character (which can be inserted when the "Edit locally" option is on), selecting all of the above, and pressing the Shift-Enter key will save the text in the file "filename". 3.3: File uploading with other systems 3.4: Help files Help files are provided which can be loaded into windows from the Macintosh disk drive; these can be customized to make use of the UNIX system and its utilities less confusing to the naive user--or, alternatively, more convenient for the experienced user. The contents of a window can be saved on the Macintosh disk, so that these "menus" can be easily modified by the user to suit his or her preferences. Similar menus can be constructed for use with any system. 3.5: Recommended settings The key-repeat speed should be set to 3 using the Control Panel desk accessory. 4: BUGS "Systems software means never being able to say you're sorry." Text is limited to 32K, and when word wrap is on it wraps very slowly. These flaws are part of the Macintosh TextEdit routines, which I have not yet replaced. Sometimes the cursor in a text window will appear to be on the end of a line, but will actually be on the beginning of the next line. Using the Reformat command or typing a Backspace at the very beginning of the text should fix this problem. Be careful about using too much memory on a 128K Mac; if your disk starts spinning frequently, it's a sign that the machine is releasing resources from memory in order to attempt to create enough space for some operation and then reloading them from the disk. You should close a window or delete some text to make more room. The Macintosh's memory management software can fail in mysterious ways, so be careful; use the Free Memory command in the "Apple" menu to find out how much space is used, and free up space if Free gets to be less than 6000 bytes. The best solution is to get a bigger Mac. Error messages and explanations: Text window full A text window has become full, and so text processing in that window has shut down to prevent TextEdit from going wacko. disk full The file could not be saved because the disk was full. disk locked The file could not be saved because the disk was locked. file locked The file could not be saved because the file was locked. file > 32KB, too big The file is too large for the Apple Macintosh standard text package, TextEdit. Modem off The modem must be on before you can use the Terminal command. no close The file could not be closed after writing. no create Couldn't create a file. no delete The file could not be deleted. no fromscrap no toscrap For some reason the system scrap can't be copied to the text scrap or vice versa. no open a window can't be opened because there is too little memory. Try deleting unnecessary material. no read Couldn't read a file. no serial write The serial port is not open. no write The attempt to write the file to disk failed. no update The volume information has not been updated, so if your machine crashes your files may not appear on the disk anymore, even if you can currently access them. out of RAM You're short of space. Try deleting unneeded material. You can use Command - to reorganize memory and tell you how short you are. Serial conf. failed The serial port setting you attempted has failed. unimplemented Alas, the feature you have attempted to use does not exist. ---