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

From: Alexandre Niveau <>
Date: Fri, 25 Jul 2014 03:16:17 +0200

> 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".

OK, I think I understand, thanks. So basically, there is no "real
delete character" in VT10X emulators? I couldn't find it in man stty,
and it's logical given the explanations in the link you provided [0].
It seems the only way to delete the character under the cursor is to
use an escape sequence ("\033[P", or maybe also "\033[1K"). That's
surprising to me!


> 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?

fr_FR.UTF-8 (more details in the enclosed file)

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

I've attached a session file. It's st from tip, running rc, without
any "stty erase" — I used my delete key as the erase character. I also
tried LC_ALL=C.UTF-8, to no avail.

Thanks for your help and explanations!

-- A.N.

Received on Fri Jul 25 2014 - 03:16:17 CEST

This archive was generated by hypermail 2.3.0 : Fri Jul 25 2014 - 03:24:06 CEST