Hi,

bash 5.2.21 produces severely wrong artifacts under the following conditions:

* the length of the prompt matches $COLUMN*2 + 1;
* the prompt contains ANSI escape sequences;
* the LANG variable is set to an installed UTF-8 locale.

When all these conditions are met, pressing the up arrow/down arrow will place the cursor in the wrong spot. After that, all typed character will be shown in the same place, overwriting each other.

To reproduce:

    $ set LANG=C.UTF-8
    $ PS1=$(eval "printf x%.0s {1..$((COLUMNS*2-1))}")$'\[\e[0m\]\$ '
    (press up arrow)
    (type anything; text ends up in the wrong place)
    $ unset LANG
    (press up arrow)
    (type anything; text is displayed correctly)

Extracted from https://bugs.debian.org/1018851

Regards,

--
Gioele Barabucci

Reply via email to