Using a vt220 clone with unix vi?

cepek at vixvax.mgi.com cepek at vixvax.mgi.com
Sat Mar 9 09:13:43 AEST 1991


In article <1991Mar7.012051.27038 at csn.org>, frechett at spot.Colorado.EDU (-=Runaway Daemon=-) writes:
> In article <pln.668280591 at egret1> pln at egret1.stanford.edu (Patrick L. Nolan) writes:
>>I would like to know if there's a way to change termcap or tset or teach
>>vi to deal with this sequence as if it was ESC.  Or maybe to make
>>the terminal send ESC, without giving up the rest of the VT220
>>keyboard mapping.
> 
> Why not make vi recognize the difference.  Here is an example while in vi:
> Type this sequence.
> :map! abc <control-V><control-[>      ^[ is <ESC>.
> So you will see
> :map! abc ^[ When you are done.
> What happens is that any time you type abc, it will send ESC to vi.  This is an
> easy thing to put in your .exrc file or just to type in.  I suspect that the
> sequence that pressing the ESC key sends is odd enough that you are not going
> to just stumble on it some day while typing.  

Taking this one step further, why not choose as your "unique sequence" the
characters that the "VT220" puts out when you press the ESC key?  It likely
puts out  <esc> [ 2 3 ~  (five characters) instead of the <esc> character
you want.  I know nothing about vi, but wouldn't that do the trick?

+----------------------------------+-----------------------------+ - - - - - -
|  Mike Cepek, Programmer/Analyst  |  Internet: CEPEK at MGI.COM    |
|  Management Graphics, Inc.       |     Voice: +1 612/851-6112  |  "Engage."
|  1401 East 79th Street           |  Operator: +1 612/854-1220  |
|  Minneapolis, MN  55425  USA     |       Fax: +1 612/854-6913  |
+----------------------------------+-----------------------------+ - - - - - -



More information about the Comp.unix.questions mailing list