Scott Gray
unread,Mar 17, 2012, 7:16:24 PM3/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jline-dev
This might be considered a relatively radical solution for a mild
annoyance, but for users of the "vi" mode it might be a pretty
frustrating annoyance.
There is an ambiguity with the ESC key. It can either be a literal
ESC, as hit by the user, or it could be a component of a terminal
escape sequence. Given the ESC is a major aspect of vi, all of the vi
implementations (vi, vim, readline, etc.) take an approach where when
ESC is hit, they do a very brief read--typically just a couple of
ms.-- to see if another character is coming. If nothing is coming
then the ESC is assumed to be literal.
JLine currently takes the approach that it does not interpret the ESC
key at all until the next key/byte is received. If the ESC is followed
by a key that is not part of a terminal escape sequence, then it is
assumed to be a literal ESC.
The problem right now is that once ESC it hit, there is no cursor at
all on the terminal until another key is hit, so there is temporarily
no frame of reference. I can solve this in the same manner as vim and
readline, but only if I implement non-blocking or interruptable I/O
and, to do this, I need to use the Java New I/O libraries (with "new"
meaning a version that was released 10 years ago - 1.4).
Before I go investing time into exploring this route are there
concerns about switching to the "nio" API's? Given that even Java 1.4
is now officially deprecated, there technically shouldn't be any
arguments about backward compatibility (but, you never know!).