home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!math.fu-berlin.de!ira.uka.de!Sirius.dfn.de!informatik.uni-frankfurt.de!atlas.rbi.informatik.uni-frankfurt.de!doemel
- From: doemel@atlas.rbi.informatik.uni-frankfurt.de (Peter Doemel)
- Newsgroups: comp.sys.hp
- Subject: Re: How to use CursorKeys etc. for command line editing
- Message-ID: <1696@diane.informatik.uni-frankfurt.de.informatik.uni-frankfurt.de>
- Date: 22 Jan 93 12:12:41 GMT
- References: <C0033013.93Jan15080649@rznb23.rz.tu-bs.de>
- Sender: news@informatik.uni-frankfurt.de.informatik.uni-frankfurt.de
- Lines: 50
-
- c0033013@ws.rz.tu-bs.de (Axel Brandes) writes:
-
- > Is there a simple way to make an ordinary shell (e.g. bash, ksh, csh)
- > working just like the DOS based user interfaces which includes:
- >
- > - using cursor keys to move in the current command line or the history
- > buffer
- > - using other keyboard specific keys (like insert)
-
- After reading the ksh man page, I found a workaround which is valid only
- in the following context:
-
- ksh + hpterm + emacs-like command line editing
-
- I added the following lines to ~/.kshrc:
-
- --------------------------------------------------------------------------
- set -o gmacs # command line editing style `emacs' with other ^T
- # (you may also use: set -o emacs)
-
- # set aliases for cursor keys (emacs soft keys)
- alias _A=^P # up
- alias _B=^N # down
- alias _C=^F # right
- alias _D=^B # left
- --------------------------------------------------------------------------
-
- Here it is important, that ^P, ^N, ^F and ^B have to be inserted as real
- control characters and not as the two character sequences as in this
- text (however, this method is not recommended in other situations,
- because control characters don't belong into ordinary texts and
- scripts).
-
- I'm using the MicroEMACS editor which provides the function
- quote-character
- for this purpose. This function is normally bound to ^Q, but often
- ^Q isn't available because of its flow control usage as XOFF,
- so you can use M-X, type quote-character hit <Return> and then
- type the control key.
-
- There surely are other ways to `patch in' the control chars.
-
- I hope this method is good enough for your problem.
-
- Peter
- --
- +----------------------------+----------------------------------------------+
- | Peter Doemel | email: doemel@informatik.uni-frankfurt.de |
- | | |
- | Johann Wolfgang Goethe | voice: |
-