[comp.sys.hp] vi doubleescape feature

QQ11@LIVERPOOL.AC.UK (11/30/90)

This is available with vi under HP-UX 7.0 (and HP-UX 6.5 and before (??)).
When set, 2 consecutive ESCs are required to exit from input mode.
It's very useful when supporting the arrow keys and allows full/proper
cursor movement in input mode.
However a quick check on other systems indicates that this feature is not
widespread. It's not available under SunOS 4.1 , SCO Un*x 3.2
and I assume 4.3 BSD and SVr3. The "User's Guide" for SVr4 makes no
mention (but then it makes no mention of a number of things :-)).

Do any other vi versions have this feature and/or is there a 'catch' ?

Thanks.

Alan Thew  : University of Liverpool Computer Laboratory
Bitnet/Earn: QQ11@LIVERPOOL.AC.UK or QQ11%UK.AC.LIVERPOOL @ UKACRL
    UUCP   :           ....!mcsun!ukc!liv!qq11
   Voice   :  +44 51 794 3735        FAX : +44 51 794 3759
Internet   : QQ11@LIVERPOOL.AC.UK or QQ11%LIVERPOOL.AC.UK @ NSFNET-RELAY.AC.UK

tmb@bambleweenie57.ai.mit.edu (Thomas M. Breuel) (12/03/90)

In article <90333.192627QQ11@LIVERPOOL.AC.UK> QQ11@LIVERPOOL.AC.UK writes:
   This is available with vi under HP-UX 7.0 (and HP-UX 6.5 and before (??)).
   When set, 2 consecutive ESCs are required to exit from input mode.
   It's very useful when supporting the arrow keys and allows full/proper
   cursor movement in input mode. [...]
   Do any other vi versions have this feature and/or is there a 'catch' ?

Sounds unnecessary: vi already disambiguates arrow keys from
user input by using timing information. For example, you can
type:

	:map! ^V^[OA ^V^[ka

to have the uparrow key function in insert mode.

Unless you have a very slow connection and are a very fast typist,
this should not present a problem.

I personally would hate it if I had to type <ESC> twice to get out
of insert mode.

vic@grep.co.uk (Victor Gavin) (12/04/90)

In article <TMB.90Dec2190057@bambleweenie57.ai.mit.edu> tmb@bambleweenie57.ai.mit.edu (Thomas M. Breuel) writes:
>In article <90333.192627QQ11@LIVERPOOL.AC.UK> QQ11@LIVERPOOL.AC.UK writes:
>   This is available with vi under HP-UX 7.0 (and HP-UX 6.5 and before (??)).
>   When set, 2 consecutive ESCs are required to exit from input mode.
>
>Sounds unnecessary: vi already disambiguates arrow keys from
>user input by using timing information.
>
>Unless you have a very slow connection and are a very fast typist,
>this should not present a problem.

HP also provide a ``set'' option to specify the max amount of time between
receiving the ESC key and a following key. If nothing is received in this time,
you get an ESC operation otherwise you get a softkey operation. This lets
people on slow dialups or network connections have proper working keyboards
without affecting people on consoles or fast serial lines (who can shorten
their timeouts to next to nothing).

As to the double escape feature: it's there to prevent you accidently typing
the escape sequence sent out by a softkey (eg on HP keyboards, the up arrow
sends out the sequence ^[A, which can be quite easily typed in manually when
you are in insert mode and want to append at the end of the line).


				vic
--
Victor Gavin <vic@grep.co.uk||vic@grep.uucp||..!ukc!grep!vic||+44 532 500303>
Grep Limited, Kirkfields Business Centre, Kirk Lane, Leeds, UK, LS19 7LX

donn@hpfcdc.HP.COM (Donn Terry) (12/06/90)

Doubleescape was created to allow for all sorts of "gotchas", the least of
which was slow systems.  The character timing information is unreliable
at best, particularly where the characters are being transmitted over
the net.  Characters typed far apart in time can arrive together due
to net delays, and the disambiguation with timing then fails.
(Occasionally, even a big "page-in" was enough to mess up the timing.)

Soft-keys (sending escape) can add to the problem.

However, this feature isn't for everyone, so it's optional.
(Actually, it's not that bad to use it; 2 escapes in a row might
as well be one keystroke, at least for me.  And moving to a system
that doesn't support it has the very minor side-effect of generating
an extra beep.)

Donn Terry
HP Ft. Collins

richard@mqcomp.mqcc.mq.OZ (Richard Miller) (12/06/90)

In article <90333.192627QQ11@LIVERPOOL.AC.UK> QQ11@LIVERPOOL.AC.UK writes:
>This is available with vi under HP-UX 7.0 (and HP-UX 6.5 and before (??)).
>When set, 2 consecutive ESCs are required to exit from input mode.
>It's very useful when supporting the arrow keys and allows full/proper
>cursor movement in input mode.
>However a quick check on other systems indicates that this feature is not
>widespread. It's not available under SunOS 4.1 , SCO Un*x 3.2
>and I assume 4.3 BSD and SVr3. The "User's Guide" for SVr4 makes no
>mention (but then it makes no mention of a number of things :-)).
>
>Do any other vi versions have this feature and/or is there a 'catch' ?
>

I've not noticed this feature  - I must give it  a go.

But most version (SunOS 4.1 etc) use a time out so that if 
an ESC and another char is received in quick succession
it is treated an ESC sequence, otherwise it is an ESC and then the
char.  This make curor movement in insert  mode a macroable thing.

This seems to be how all multiple char marcos are handled.

Richard
 ____________________________________________________________________________
|   __                                                                       |
|  /_/ -__ /_ _ _ _ __/  /\/\ -//  _                                         |
| / \ /(_ / /(_/ / (_/  /   ////(~/                                          |
|                                                                            |
| School Math, Physics, Elec and Computing, Macquarie University SYDNEY AUST.|
|  Email: richard@mqcomp.mqcs.mq.oz.au ,Ph:+61 2 8058374, Fax:+61 2 8058983  |
|____________________________________________________________________________|

sartin@hplabsz.HPL.HP.COM (Rob Sartin) (12/07/90)

If you've ever used an error correcting modem (on a noisy line) or a
slow (or error prone) network connection, you know that any mechanism
involving timeouts on multicharacter sequences is subject to all sorts
of fun errors.  If you use vi in this type of situation you will find
that doubleescape is a wonderful addition.  If not, then you can
probably rely on the timeouts and have no problems.

Disclaimer: If HP had a net.spokesperson it wouldn't be me.

Rob