Prompt overwrites command output if prompt contains unicode character and non-printing escape sequence

Lennart Ackermans via Bug reports for the GNU Bourne Again SHell <[email protected]> Sat, 16 May 2026 21:28:46 +0200
Newsgroups gmane.comp.shells.bash.bugs
Message-ID <[email protected]>
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -Werror=implicit-function-declaration 
-fstack-protector-strong -fstack-clash-protection -Wformat 
-Werror=format-security -fcf-protection -Wall
uname output: Linux lennart-laptop 7.0.4+deb14-amd64 #1 SMP 
PREEMPT_DYNAMIC Debian 7.0.4-1 (2026-05-07) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

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€