[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Troubles with UTF-8 line editing

From: Egmont Koblinger
Subject: Troubles with UTF-8 line editing
Date: Wed, 28 Jul 2004 22:10:47 +0200 (CEST)


I've just upgraded to readline 5.0 and bash 3.0 and tried them with UTF-8
encoding. I found line editing to be quite buggy:

I type an accented letter, let's say á. Then á appears. I press the left
arrow, the cursor goes back, it is now over á. I press é. Now éá is
visible, which is correct, but the cursor is past the two letters, though
it should be over á. Here only the first Left arrow takes affect, moves
the cursor over á, but the 2nd time I press Left, it just beeps, doesn't
move to the first char (é). Now a Right arrow doesn't move the cursor, but
causes further Left and Right arrows to work as expected. To go on,
similar bug occurs nearly every time that I insert an accented letter
before or amongs other ones (but not at the end of the line). When the
command line has about ten or twenty accented letters (and no or hardly
any non-accented ones), line editing becomes a total chaos, where
sometimes inserting another accented letter causes the cursor to jump many
characters to the right, and pressing the Left arrow sometimes causes the
cursor to jump back lots of characters at once.

The terminal is physically set to UTF-8 encoding, and LANG=hu_HU.UTF-8 is
set before I even launch bash. Later I don't alter this variable. I have
no LC_* variables, and I do have hu_HU.UTF-8 locale on my system. Tested
this phenomemon both under Linux console and Gnome-terminal 2.6, just to
be more sure it's not my stupidness. I have no trouble using joe-3.1,
vim-6.3 and ne-1.35 text editors with utf-8 encoded files under these
terminal settings.

Based on the phenomenon described above, and sometimes pressing ^L to
redraw the line it seems to me that readline is always correctly aware of
what the current line should be and where the cursor should stay, it just
fails to correctly display it.

Anyway, it is a Linux i386, glibc 2.3.3, gcc 3.3.4, kernel 2.6.7, ncurses
5.4... I don't know if any of these matter.
readline 5.0, bash 3.0 compiled --with-installed-readline against rl 5.0.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]