On 5/16/26 3:28 PM, Lennart Ackermans via Bug reports for the GNU Bourne Again SHell wrote:

Bash Version: 5.3
Patch Level: 9
Release Status: release

Description:
    If $PS1 contains a unicode character followed by an escape sequence, the prompt appears to be output twice if a command ends without a newline: once (correctly) after the output and once at the beginning of the line, overwriting the output. The cursor is placed after the first, overwriting prompt (on "s" in the example below).

   This bug was not present in Bash 5.2.

Repeat-By:
     bash-5.3$ PS1='€ \[\e[0m\]'
     € echo -n test
     € st€

If the cursor isn't at position 0 when readline starts, results will be
unpredictable. Readline has to know where it is on the screen so it can
make decisions about which escape sequences to use to move the cursor.
This isn't necessarily the result of having any particular characters in
the prompt string, though having a sequence of non-printing characters
means that readline really does need to know where it is on the screen.

A simple newline will fix this.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

  • Prompt ov... Lennart Ackermans via Bug reports for the GNU Bourne Again SHell
    • Re: ... Chet Ramey
      • ... Lennart Ackermans via Bug reports for the GNU Bourne Again SHell
        • ... Grisha Levit
          • ... Chet Ramey
            • ... Chet Ramey

Reply via email to