home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / hp / 15205 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  2.4 KB

  1. Path: sparky!uunet!math.fu-berlin.de!ira.uka.de!Sirius.dfn.de!informatik.uni-frankfurt.de!atlas.rbi.informatik.uni-frankfurt.de!doemel
  2. From: doemel@atlas.rbi.informatik.uni-frankfurt.de (Peter Doemel)
  3. Newsgroups: comp.sys.hp
  4. Subject: Re: How to use CursorKeys etc. for command line editing
  5. Message-ID: <1696@diane.informatik.uni-frankfurt.de.informatik.uni-frankfurt.de>
  6. Date: 22 Jan 93 12:12:41 GMT
  7. References: <C0033013.93Jan15080649@rznb23.rz.tu-bs.de>
  8. Sender: news@informatik.uni-frankfurt.de.informatik.uni-frankfurt.de
  9. Lines: 50
  10.  
  11. c0033013@ws.rz.tu-bs.de (Axel Brandes) writes:
  12.  
  13. > Is there a simple way to make an ordinary shell (e.g. bash, ksh, csh)
  14. > working just like the DOS based user interfaces which includes:
  15. >
  16. > - using cursor keys to move in the current command line or the history
  17. >   buffer
  18. > - using other keyboard specific keys (like insert)
  19.  
  20. After reading the ksh man page, I found a workaround which is valid only
  21. in the following context:
  22.  
  23.     ksh + hpterm + emacs-like command line editing
  24.  
  25. I added the following lines to ~/.kshrc:
  26.  
  27. --------------------------------------------------------------------------
  28.     set -o gmacs    # command line editing style `emacs' with other ^T
  29.             # (you may also use: set -o emacs)
  30.  
  31. # set aliases for cursor keys (emacs soft keys)
  32.     alias _A=^P    # up
  33.     alias _B=^N    # down
  34.     alias _C=^F    # right
  35.     alias _D=^B    # left
  36. --------------------------------------------------------------------------
  37.  
  38. Here it is important, that ^P, ^N, ^F and ^B have to be inserted as real
  39. control characters and not as the two character sequences as in this
  40. text (however, this method is not recommended in other situations,
  41. because control characters don't belong into ordinary texts and
  42. scripts).
  43.  
  44. I'm using the MicroEMACS editor which provides the function
  45.     quote-character
  46. for this purpose. This function is normally bound to ^Q, but often
  47. ^Q isn't available because of its flow control usage as XOFF,
  48. so you can use M-X, type quote-character hit <Return> and then
  49. type the control key.
  50.  
  51. There surely are other ways to `patch in' the control chars.
  52.  
  53. I hope this method is good enough for your problem.
  54.  
  55. Peter
  56. -- 
  57. +----------------------------+----------------------------------------------+
  58. |        Peter Doemel        | email: doemel@informatik.uni-frankfurt.de    |
  59. |                            |                                              |
  60. |   Johann Wolfgang Goethe   | voice:                                       |
  61.