> From terminal to application there is a problem: The ESC could be typed or
> could be the start of an escape sequence.  This is especially a problem
> for Vi, because ESC is used to get out of Insert mode.  The difference
> between a typed ESC and the start of an escape sequence can only be
> guessed by using a timeout.

It is an obvious bug in modern versions of vi that the keystroke
sequences that it parses do not form a prefix code. The original vi
didn't care about function keys (such as cursor controls) and therefore
didn't have this bug. Extended versions of vi should have abandoned ESC
as the insert mode terminator in favour of some other mechanism (for
instance Ctrl-X (CAN) would seem fully appropriate and is easy to enter).

ESC is *not* just another function key. It is a key that was intended to
allow users to enter arbitrary function key sequences.

May be, ESC could be turned into a proper function key as Ctrl-[ is
still available to serve for hand-generating arbitrary ESC sequences.

The other option is of course to start all function key sequences with
CSI instead of ESC [.

I guess both solutions bring the usual bag of backwards compatibility
problems with them, but if we end up writing a simplified concise new
text terminal standard some day, we definitely should take these options
into consideration.

Vi's usage model (with insert modes and the need to get out of them,
etc.) is anyway horribly outdated. It has been my (understandable)
experience that beginners simply hate vi. Encouraging students in a Unix
beginners class to get used to vi is the main reason why Unix get's such
an arcane flavour associated with it for young students. Olttimers like
myself (I just turned 30 ;-) use vi primarily because it is for strange
historic reasons more widely installed than more modern alternatives
such as pico, joe, mined et al. that are permanently in insert mode. The
only other editor old enough to be ubiquitously installed is Emacs, but
people don't use it universally because of its huge resource
requirements and the fact that it requires >> 200 ms to start it as a
new process.

I would have loved to see POSIX.2 standardize another editor than vi,
but they failed to do that.

Markus

-- 
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org,  WWW: <http://www.cl.cam.ac.uk/~mgk25/>

-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/

Reply via email to