home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume8 / micrognu / part04 / tty / termcap / readme next >
Encoding:
Text File  |  1987-01-26  |  6.0 KB  |  141 lines

  1.  
  2.     MicroGnuEmacs Termcap Terminal Capabilities
  3.  
  4. The termcap library needs to know where to get the terminal type and
  5. termcap capibilities file from.  UNIX and Os9/68k users should "setenv
  6. TERM" to their terminal type, and "setenv TERMCAP" if they are using a
  7. non-standard termcap file.  VMS users should see AAAREADME.1ST for
  8. information on how to define the logical names TERM and ETC to point
  9. to the termcap definition file.  Users of other operating systems
  10. should do the aproprate thing.  For an example of a termcap file, UNIX
  11. users may look in /etc/termcap, Os9/68k users may look at
  12. /dd/sys/termcap (if present), and VMS users should see the file
  13. [.SYS.VMS.TERMCAP]TERMCAP. 
  14.  
  15. MicroGnuEmacs requires that certain terminal capabilities exist in the
  16. specified termcap entry.  The "cm" (cursor motion) capability *must*
  17. be available to use MicroGnuEmacs.  (Yes, it is possible to fake cm
  18. with some other capibilities, but MicroGnuEmacs doesn't try.)  If your
  19. terminal is one that uses control characters in the paramater portion
  20. of the "cm" string, the "up" and "bc" capabilites may also be needed.
  21. (See your termlib documentation for when this is so.)
  22.  
  23. If the following capabilities are available, they are used.  The AL
  24. and DL sequences are not totally standard, but having them improves
  25. the performance of the editor, since it doesn't have to redraw the
  26. screen to delete a line.  They should not be used if they need control
  27. characters as paramaters.
  28.  
  29.     cd    -- clear display
  30.     ce    -- clear to eol
  31.  
  32.     al    -- insert 1 line
  33.     dl    -- delete 1 line
  34.  
  35.     AL    -- parametrized insert line (note capitalization)
  36.     DL    -- parametrized delete line (note capitalization)
  37.  
  38.     ti    -- cursor movement initialization string
  39.     te    -- cursor movement end string
  40.  
  41. The cs capability is not as standard as some of the other
  42. capibilities, but is used by MicroGnuEmacs when available.  It is used
  43. to define a "scrolling region", which defines a window within the
  44. screen where all the action takes place.  A newline character at the
  45. bottom of this area scrolls the rest of the text in the area up one
  46. line, just like the normal screen; a reverse linefeed (sr) at the top
  47. of the window moves all the text in the area down a line.
  48. MicroGnuEmacs does not properly handle "cs" if your terminal needs
  49. control characters as paramaters, and in this case "cs" should not be
  50. defined.  
  51.  
  52. If the cs and sr capabilities are available, the termcap driver uses
  53. these to make the insert/delete line functions work more smoothly. If
  54. only the cs capability is present, it is still used for the delete
  55. line function, but not for inserting lines.
  56.  
  57. The definition of the cs capability is: the first parameter in the
  58. sequence defines the first row (origin 0) that is in the scrolling
  59. region, and the second argument defines the last row to include in the
  60. scrolling region.
  61.  
  62.     cs    -- set scrolling region (arg1 = top, arg2 = bottom)
  63.     sr    -- reverse index
  64.  
  65. The following capabilities provide for an enhanced (reverse-video
  66. or otherwise rendered) mode line.  The sg entry should not be present
  67. on terminals that do this to characters as they are placed on the
  68. screen.  Terminals that    put a region of the screen in the standout
  69. mode should have sg defined as numeric: :sg#0: for terminals that do
  70. this on regions but don't take any character positions to do this,
  71. (this may be a non-standard interprition of the meaning of sg) and the
  72. number of character positions taken by any other terminal.
  73.  
  74.     so    -- enter standout mode
  75.     se    -- leave standout mode
  76.     sg    -- number of character positions used by standout
  77.  
  78.             Function Keys
  79.  
  80. If MicroGnuEmacs is compiled with XKEYS defined, a new feature of the
  81. termcap driver is support for function keys, based on the termcap
  82. entry that defines the terminal.  This may not be be deisriable in all
  83. cases, especially those in which the terminal in use does not use ESC
  84. as the first character of all arrow and function keys.  If you do
  85. deside to use this feature, don't expect it to work with all terminal
  86. types.  Those termial types it doesn't work with will have to use
  87. modified termcaps that do not include the termcap sequences described
  88. below to be useful with MicroGnuEmacs compiled with the XKEYS option. 
  89. XKEYS also interferes with the proper operation of delayed prompts.
  90.  
  91. The termcap "standard" provides for a number of sequences that define
  92. how to activate the function keys, what the function key sequences
  93. are, and the names of the function keys.  The termcap driver uses the
  94. following capabilities to parse for function key sequences:
  95.  
  96.     ks    -- start using function keys
  97.     ke    -- finish using the function keypad
  98.     kh    -- home key
  99.     ku    -- up arrow
  100.     kd    -- down arrow
  101.     kl    -- left arrow
  102.     kr    -- right arrow
  103.     k0-k9    -- standard termcap function keys (1-10)
  104.     l0-l9    -- labels for same
  105.  
  106. The following key capabilities are not standard, but are used if
  107. they are in the termcap:
  108.  
  109.     K0-K9    -- function keys 10 through 19
  110.     L0-L9    -- labels for same
  111.  
  112. For example, the DEC LK201 (vt200-series, VAXstation) keyboard has an
  113. editing keypad. A VT200 termcap entry could include the following
  114. capabilities to go into application keypad mode, set up the arrow keys,
  115. and map the editing keypad to internal function key codes KF0-KF7:
  116.  
  117.     ...the beginning of the termcap entry....
  118.     :ks=\E[?1h\E=:ke=\E[?1l\E>:\
  119.     :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kh=\E[H:\
  120.     :k0=\E[28~:l0=Help:\
  121.     :k1=\E[29~:l1=Do:\
  122.     :k2=\E[1~:l2=Find:\
  123.     :k3=\E[2~:l3=Insert Here:\
  124.     :k4=\E[3~:l4=Remove:\
  125.     :k5=\E[4~:l5=Select:\
  126.     :k6=\E[5~:l6=Prev Screen:\
  127.     :k7=\E[6~:l7=Next Screen:\
  128.  
  129. There is one problem with supporting function keys: If the META
  130. introducer key (usually ESC) is used as the initial character of a
  131. function key sequence, how is the parser to know when the user intends
  132. the introducer to be taken at face value?  The parser doesn't have
  133. enough information.
  134.  
  135. The approach the current code takes is that if the META introducer is
  136. the first character in a function sequence, and the second character c
  137. isn't part of a function key sequence, the parser returns (KMETA | c).
  138. If it sees *two* META introducers in a row, it returns one instance of
  139. METACH. This approach is subject to discussion and debate, but it
  140. works right most of the time.
  141.