2016-01-11 15:50:55 +0000, Stephane Chazelas:
[...]
> $ printf '|\uFF21\b\b|\n'
> ||
> $ printf '|\uFF21\b|\n'
> | |
> 
> in both xterm and gnome-terminal. As in, you need two backspace
> characters to delete that character. With only one, the cursor
> moves back one column, and if you write another character, the
> double-width glyph is erased (leaving an empty single-width
> space and your replacement character).
> 
> So it's right that colrm should assume that
> <a-double-width-charater>\b\b doesn't change the cursor
> position.
[...]

FWIW, the colrm on Debian from bsdmainutils 9.0.3
seems to behave properly:

$ printf '%b123\n' xaa 'x\uFF21' 'xa\bba\bb' 'x\uFF21\b\bbb'
xaa123
xA123
xbb123
xbb123
$ printf '%b123\n' xaa 'x\uFF21' 'xa\bba\bb' 'x\uFF21\b\bbb' | colrm 1 3
123
123
123
123

(copy-pasted from xterm).

-- 
Stephane

Reply via email to