lkml.org 
[lkml]   [1999]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Unicode console patch
On Sun, 31 Jan 1999, H. Peter Anvin wrote:

> > Is it possible to read e.g. the cursor position without flushing the input
> > buffer?
>
> I don't know if that is practical; there are ways to do it but
> unfortunately they are usually security holes.

Of course it's practical. I've made a patch for bash which handles command
line editing in UTF-8 (now it's slightly outdated). It must check the mode
after every command, because any command may switch modes. If mode checking
flushes input buffer, user can't type the next command while the previous
one is executing, which I do very often.

So I get all pending input and push it into bash's internal input buffer
before mode checking (which is done by outputting a UTF-8 sequence,
measuring how much did the cursor move, and erasing that temporary
characters). This causes side effects when I e.g. type "pine <ENTER> i"
while I am logging in, because everything is put into bash's buffer, while
the "i" should be interpreted by pine. Also that way of mode checking is
a pain, it destroys 3 chars from the display and depends on the terminal
escape sequences (in xterm it has the side effect of moving cursor one
character to the right - I didn't investigate it).

There must be a way to check mode without flushing input! Future editors,
readline, curses etc. will want to work correctly in UTF-8 mode. Now they
can hardly be improved in that direction, because there is no good way to
check the mode, and flushing input is mostly inacceptable.

At least UTF-8 mode vs. 8bit mode. But in another tool I would want to
check all the details: what is under G0 and G1, which is active etc. Now I
can get the whole user-loaded mapping (by ioctl), but I can't test whether
it is activated or not!

--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://kki.net.pl/qrczak/
\__/ GCS/M d- s+:-- a21 C+++>+++$ UL++>++++$ P+++ L++>++++$ E->++
^^ W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK 5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.534 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site