Re: [dev] [st] Erasing UTF-8 characters in ed

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Thu, 24 Jul 2014 23:52:20 +0200

> > If you use Delete, the prblem is fixed?,
>
> With the tip version of st, Delete works as a backspace outside ed,
> but writes "^?" when used in ed.

In fact, in all the other systems backspace works as Delete. Delete
is 7FH, or ^?, and backspace is 08H, or ^H. The point here is that, by
default, linux assumes that your key for removing previous character
is (erase key) is delete, that is remapped into the position of
backspace. I had sent a patch to the FAQ explaining why, and where
the problem comes.

Almost of the moderm shell do line editing today, so they not use
the kernel driver anymore, and they use the terminfo definition
of bs, that in your system should be ^H. But, they try to be even more
smart and deal delete (^?) or backspace (^H) in the same way: to
delete the previous character (without consulting terminfo database).
This is the reason why you think "Delete works as a backspace outside ed".

> Same behaviour as with the 0.5 release of st (as clunkily explained in
> my initial message).

Well, let me think. You press Backspace key (which generates ^H), and your
configuration of stty says that erase is ^H, but then it seems that it is
deleted only the last byte of the previous utf8 rune. This action is
performed by the kernel, so the first thing we have to discard is a
problem related with locales. What locales are you using?

Could you send a file with a small sesion where I could see the problem?
(sssion files can be generated using -o option)

Regards,

-- 
Roberto E. Vargas Caballero
Received on Thu Jul 24 2014 - 23:52:20 CEST

This archive was generated by hypermail 2.3.0 : Fri Jul 25 2014 - 00:00:21 CEST