home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d01xx / d0100.lha / Conman / conman.doc < prev    next >
Text File  |  1987-09-07  |  14KB  |  281 lines

  1. =========================================================================
  2.                               ConMan V1.0
  3.                  Copyright (c) 1987 by William S. Hawes
  4. =========================================================================
  5.  
  6. ConMan is a replacement console handler that provides line editing and
  7. command line histories.  It runs under AmigaDOS V1.1 or V1.2 and is
  8. completely transparent to any application program that uses CON: windows.
  9. Once installed, all windows opened by AmigaDOS will automatically use the
  10. ConMan handler.  This includes command windows opened by NEWCLI as well
  11. as any data input/output windows that your program uses.
  12.  
  13. In addition to the basic line-editing functions, ConMan provides a number
  14. of standard control-key options, several function-key definitions, and a
  15. procedural interface designed to assist "shell" programs and other
  16. utilities.  It can also be opened as a (switchable) RAW: mode handler and
  17. as a "pipe."
  18.  
  19.  
  20. Line Editing.
  21. ConMan allows you to edit the active (command) line using the left- and
  22. right-arrow keys for cursor positioning.  The DEL key removes the character
  23. under the cursor, and the BACKSPACE key deletes the character to the left
  24. of the cursor.  The shifted left-arrow key skips to the beginning of the
  25. current or previous word, and the shifted right-arrow key skips to the
  26. position beyond the end of the current or next word.
  27.  
  28. The editing mode may be set to either insert or overstrike characters at
  29. the cursor, and can be "toggled" with the CTRL-A key.  The input mode is
  30. controlled by two global flags maintained in the ConHandler library 
  31. structure.  One flag determines the mode in effect when the window is 
  32. first opened and after each line is entered, and defaults to "insert." 
  33. The other flag determines whether the mode is "sticky" -- whether it 
  34. remains set or reverts to the initial setting after each line is entered.
  35.  
  36. The mode flags can be selected when you first install ConMan, and can be
  37. changed at any time using the provided SetCMan command utility.  Try 
  38. experimenting with the input modes to see which you prefer.  Note that
  39. these are global flags and therefore apply to ALL ConMan windows.
  40.  
  41. Several control keys are provided to delete all or part of the active line.
  42. CTRL-X deletes the entire line, while CTRL-Y deletes from the cursor position 
  43. to the end of the line.  CTRL-Z deletes both the current line and any lines 
  44. that have been entered (but not yet read); this is very handy if you want to
  45. completely abandon all typed-ahead lines.  CTRL-R provides a less drastic
  46. recourse by recalling entered lines one at a time and posting them back to 
  47. the command line.
  48.  
  49. CTRL-S and CTRL-Q have been implemented to hold and release the screen        
  50. output, respectively.  While the CTRL-S action is not strictly necessary,
  51. since entering any character will halt output to the screen, it is a
  52. standard control option.  CTRL-W clears the entire window and refreshes
  53. the active line.
  54.  
  55. One other control character is recognized:  CTRL-\ sends an end-of-file
  56. (a zero-length block) to the task reading from the handler.
  57.  
  58. All characters not explicitly required for editing purposes are passed on
  59. to the command line.  In order to provide a consistent display, characters
  60. that might cause interference with the display (like CTRL-L) are displayed
  61. as a caret (^) followed by the uppercase alphabetic character.
  62. Miscellaneous non-printable characters are displayed as a hash mark.
  63.  
  64.  
  65. Command History.
  66. Previously-entered lines can be recalled sequentially with the up-arrow key.
  67. If you go past the one you want, the down-arrow key will retrieve the next
  68. (more recent) line.  The shifted up-arrow key recalls the oldest line, and
  69. shifted down-arrow recalls the most recent line.  
  70.  
  71. The history buffer is organized as a fixed-length memory "pool" with a
  72. default length of 488 bytes.  Each new line is entered at one end, and
  73. the oldest lines are "pushed off" the other end to make room.  The number
  74. of lines that can be saved depends on their lengths, but is generally in
  75. the range of 25 to 30.  The default size can be changed by modifying a field
  76. in the library structure.
  77.  
  78. The command history can be maintained in one of two modes.  In the default
  79. mode, recalled lines are not re-entered into the history buffer unless the
  80. line is "touched," and the history index pointer is left set at the
  81. retrieved line.  This mode is convenient if you often go back into the buffer 
  82. to retrieve sequences of commands.
  83.  
  84. In "true history" mode, every line is re-entered into the history buffer,
  85. even if it wasn't modified after being recalled.  The history pointer is
  86. always reset (to the most recent line) whenever a line is placed into the
  87. buffer.
  88.  
  89. The history mode can be selected when ConMan is installed or by using the
  90. SetCMan utility.
  91.  
  92.  
  93. Function Keys.
  94. Four function keys have been assigned default actions.  Key F1 shrinks
  95. ("iconifies") the window to its minimum size, while F2 "zooms" the 
  96. window to its maximum size (usually the entire screen.)  Both keys act as
  97. "toggles," and shrunken windows may be zoomed (and vice-versa.)  If the 
  98. window was opened without a sizing gadget, neither F1 or F2 will have any 
  99. effect.
  100.  
  101. Function key F9 moves the screen to the front or back of the display, and 
  102. F10 moves the window to the front or back.  Both keys act as "toggles" 
  103. provided that you don't deactivate the window or screen.  These keys are
  104. useful when you're working with multiple windows or screens and need to 
  105. peek at the one in back.
  106.  
  107.  
  108. Window Definition.
  109. ConMan accepts the standard AmigaDOS window specifications.  For example,
  110. "CON:160/50/320/100/MyWindow" specifies a window 320x100 pixels in size,
  111. beginning in position (160,50).  The numeric parameters are truncated
  112. against the maximum screen size, so a larger-than-normal window may be
  113. safely specified (for those of you using "morerows").  The default size
  114. is the full screen width and height.  ConMan computes the minimum size
  115. for the window based on the length of the title and the gadgets present.
  116. The actual size of the window is used as the upper bound for the minimum, 
  117. so very small windows (e.g. "con:0/0/1/1/") can be specified.
  118.  
  119. ConMan also accepts a specification in the form "CON:w20480", where the 
  120. hex digits following the "w" are the absolute address of an Intuition 
  121. window pointer.  If you're writing in "C," the following sequence would 
  122. serve to open a window and attach a DOS console to it:
  123.  
  124.       window = OpenWindow(&newwindow);   /* get a window          */
  125.       sprintf(buffer,"CON:W%x",window);  /* build the name string */
  126.       file  = Open(buffer,MODE_OLDFILE); /* open a console stream */ 
  127.  
  128. You can open a console on a custom screen by including the screen pointer
  129. in the specification string, as in "CON:S123abc/10/10/300/100/MyWindow."
  130.  
  131. Various Intuition options and gadgets can be selected by including a list
  132. of attributes after the window title.  Here's how it works:  put another 
  133. slash ("/") after the window title, and follow it with any of the
  134. attribute options listed below.
  135.  
  136.    Option Character                 Default Value    
  137.    ----------------                 -------------
  138.    A <==> Activate                  Activated
  139.    B <==> BackDrop                  Not a backdrop
  140.    C <==> Close gadget              No close gadget
  141.    D <==> Depth gadgets             Depth gadgets
  142.    M <==> Move (drag) gadget        Drag gadget
  143.    N <==> NoBorder                  Border (sorry, "B" was used)
  144.    R <==> Refresh (SMART/SIMPLE)    Smart refresh
  145.    S <==> Sizing gadget             Sizing gadget
  146.    Z <==> Zero-Zero                 Not a GZZ
  147.  
  148. Each attribute serves to TOGGLE the corresponding windows flag, so including
  149. an attribute twice will cancel the effect.  A closing slash is optional.
  150. For those of you who wanted a slash in your titles:  sorry.
  151.  
  152. Example: CON:10/10/300/100/Behind/nb/   a borderless backdrop window.
  153.          CON:10/10/300/100/Fixed/acm    a nonactivated window, with a 
  154.                                         close gadget, that won't budge.
  155.  
  156. Installation.
  157. ConMan requires that two files be copied to your SYS: disk (don't worry,
  158. they're both small.)  Place the file "Conhandler" (184 bytes) in your
  159. SYS:L directory, to keep all those bigger handlers company.  Copy the
  160. file "conhandler.library" (5912 bytes) into your LIBS: directory, which 
  161. is normally SYS:LIBS.  If you received ConMan in the form of an ARCed
  162. file, be sure to rename "conlib.lib" and "chandler", or use the provided 
  163. "ARCinstall" script to copy the files.
  164.  
  165. Once these files are present, execute "ConMan" (976 bytes) to install the
  166. handler.  This command should only be run once, as it allocates 20 bytes
  167. of memory for the handler name string which won't be released (there is no 
  168. provision in DOS for removing a handler, anyway.)  You can specify several
  169. command-line arguments when you execute ConMan:
  170.  
  171.    Code    Action
  172.    ----    ------
  173.    -c      install as CON: (the default)
  174.    -o      select overstrike mode
  175.    -q      execute "quickly" (don't open a window)
  176.    -r      install as RAW:
  177.    -s      select "sticky" mode
  178.    -t      maintain "true history"
  179.  
  180. These command options may appear in any order and remain in effect until
  181. you reboot the computer.  The -q option is recommended if the ConMan command
  182. is inserted in your startup script (SYS:s/startup-sequence).
  183.  
  184. A separate utility program called "SetCMan" (136 bytes) has been provided
  185. to modify some of the global mode flags.  You can use SetCMan to change
  186. the -o, -s, or -t options at any time.
  187. Examples: conman  -c -q -t
  188.           setcman -o -s -t
  189.  
  190. Distribution.
  191. This program is to be distributed as shareware to Amigoid life-forms 
  192. everywhere!  Make sure your friends get a copy.  Comments and contributions
  193. will be appreciated and may be sent to:
  194.  
  195.       William S. Hawes        (bix: whawes)
  196.       P.O. Box 308
  197.       Maynard, MA 01754
  198.       (617) 568-8695
  199.  
  200. The suggested contribution (based on the shareware survey below) is $10,
  201. but any amount is welcome.
  202.  
  203. Shareware Survey.
  204. Special thanks to all those contributed while ConMan was still in its
  205. beta-test stage!  The contributions received for the four beta releases 
  206. are summarized below:
  207.  
  208.    Amount      Received
  209.    ------      --------
  210.    $ 5.00          2
  211.     10.00         13
  212.     12.50          1
  213.     15.00          6
  214.     20.00          4
  215.  
  216. Since $10 is by far the most popular amount, it is hereby declared the
  217. "suggested contribution".
  218.  
  219. Cast your vote for inexpensive software!  Distribution as shareware is
  220. advantageous to both the producer and consumer.  You get to decide what 
  221. products to support, but without your support the authors will have to 
  222. direct their efforts elsewhere.  Which way will you vote?
  223.  
  224.  
  225. Further Notes.
  226. ConMan answers to several names in addition to "CON:".  You can define a
  227. "CNC:" device using the "mount CNC:" command after appending the included
  228. "mountlist" file to your DEVS:mountlist.  The CNC: device can then be
  229. opened just like a CON: window.  This allows the CON: definition to be
  230. left intact in case there are any imcompatibilities between ConMan and 
  231. your existing software ...  but please let me know of any problems!.
  232.  
  233. The ConMan handler was specifically designed to simplify the process of
  234. writing a "command shell".  Since the handler is built as a library, 
  235. a number of the internal functions can be brought out to assist external
  236. programs that use the console.  I have built the "C" header file and 
  237. binding routines required to call the library functions, and will be 
  238. documenting the programming aspects of the handler at some point.
  239. Stay tuned for more information.
  240.  
  241. I'm planning to add a few new features in a future release of the handler.
  242. Several people expressed interest in having the handler not display 
  243. typed-ahead lines, so that a currently-running program can write freely to
  244. the screen and lines will be displayed only as they are read.  This is 
  245. fairly easy to implement, and will be selectable using a global flag.
  246.  
  247. Another planned option is to make the control key actions selectable.
  248. I'll probably define a table of possible actions and let you match them
  249. up with control keys.  This again is easy to implement.
  250.  
  251.  
  252. Bugs.
  253. One known bug occurs when the handler is being used in RAW: mode with
  254. the ED editor.  The editor works fine until it exits, whereupon it GURUs
  255. with an 8700004 code.  Other utilities work fine with the handler in
  256. RAW: mode.
  257.  
  258. Problems have been reported about incompatibilities between ConMan and 
  259. ABasic, the first basic shipped with the machine (remember V1.0?).  
  260. I no longer have ABasic, having long ago recycled the disk (my current 
  261. system disk, actually).  Once I get a new copy to play with, maybe the
  262. problem can be cleared up.
  263.  
  264. One warning with regard to the "shrink" and "zoom":  rapid toggling between
  265. window states will crash the machine.  The problem appears to be an 
  266. interaction between Intuition and the console device, but until I find a
  267. a reasonable work-around, take it easy on the keys, OK?  
  268.  
  269. An additional warning: the console device exhibits serious problems with 
  270. supporting windows below some minimum size.  Opening windows of certain
  271. sizes (e.g. con:0/0/10/20/) may cause the machine to crash, whether or not
  272. ConMan is active.  For these reasons, I highly recommended that you avoid
  273. console windows smaller than 60X25 or so.
  274.  
  275.  
  276. Acknowledgements.
  277. Special thanks to John Toebes and the Software Distillery for all the great 
  278. suggestions, and to everyone who called in with comments or contributions.
  279.  
  280.                                     WSH (08/25/87)
  281.