[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Incorrect positioning when long prompt contains ANSI escape sequences +
From: |
Gioele Barabucci |
Subject: |
Incorrect positioning when long prompt contains ANSI escape sequences + UTF-8 LANG |
Date: |
Thu, 8 Aug 2024 21:40:48 +0200 |
User-agent: |
Mozilla Thunderbird |
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
- Incorrect positioning when long prompt contains ANSI escape sequences + UTF-8 LANG,
Gioele Barabucci <=