On Tue, Dec 08, 2015 at 01:19:35AM +0100, Ingo Schwarze wrote:
> Hi,
>
> i'd like to propose a simplified version of this patch Frederic Nowak
> posted a few weeks ago for commit. Our experience is probably
> not yet sufficient to develop a full-blown solution for all UTF-8
> problems in ksh(1), but this is very non-intrusive and makes the
> following commands better without breaking anything:
>
> * Ctrl-b, Ctrl-xd, Esc-[D, Esc-OD (backward-char)
> * Ctrl-f, Ctrl-xc, Esc-[C, Esc-OC (forward-char)
> * Ctrl-h, Ctrl-? (delete-char-backward)
> * Esc-[3~ (delete-char-forward)
> * Ctrl-k (kill-to-eol)
>
Hi Ingo,
While testing ksh, I found the following problem, that I will try to
describe. But I dunno if it is just a case no-managed by your patch. It
looks like a problem in "inserting a UTF-8 char inside the line (opposed
to 'at end of line')".
Else your patch is pretty readable, and it would be a good first step.
# type echo aàa
$ echo aàa
^ cursor here
# move two char backward (using arrow or using Ctrl-b)
$ echo aàa
^ cursor here
# add 'é' char (UTF-8) (there are no problem with non UTF-8 char like 'b')
# => visual problem starts
$ echo àaa
^ cursor here
# hit enter
$ echo àaa
aéàa
###
another way (maybe more simple):
# type echo abc
$ echo abc
^ cursor here
# go start-of-line with Ctrl+A
$ echo abc
^ cursor here
# insert é UTF-char
$echo abcc
^ cursor here
in the same manner, it is just a "visual effect", as the line is really
"éecho abc" (tested with cut/paste: Ctrl+U Ctrl+Y)
Thanks
--
Sebastien Marie