Readline 8.3 regression: Prompt corruption with multibyte characters
Juan Monroy Nieto via Bug reports for the GNU Bourne Again SHell <[email protected]> Fri, 3 Jul 2026 09:53:17 +0000
| Newsgroups | gmane.comp.shells.bash.bugs |
|---|---|
| Message-ID | <GVXPR03MB11598ED5CA74291C6744761D1C0F42@GVXPR03MB11598.eurprd03.prod.outlook.com> |
Configuration Information: Machine: x86_64 OS: linux-gnu Compiler: gcc Comp= ilation CFLAGS: -march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-plt -fexcep= tions -Wp,-D_FORTIFY_SOURCE=3D3 -Wformat -Werror=3Dformat-security -fstack-= clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-fra= me-pointer -flto=3Dauto -DDEFAULT_PATH_VALUE=3D'/usr/local/sbin:/usr/local/= bin:/usr/bin' -DSTANDARD_UTILS_PATH=3D'/usr/bin' -DSYS_BASHRC=3D'/etc/bash.= bashrc' -DSYS_BASH_LOGOUT=3D'/etc/bash.bash_logout' -DNON_INTERACTIVE_LOGIN= _SHELLS -std=3Dgnu17 uname output: Linux mylaptop 6.12.94-1-MANJARO #1 SMP = PREEMPT_DYNAMIC Fri, 19 Jun 2026 12:26:13 +0000 x86_64 GNU/Linux Machine Ty= pe: x86_64-pc-linux-gnu Bash Version: 5.3 Patch Level: 15 Release Status: release Hi everyone, I believe I=92ve found a prompt display error in Readline 8.3: the prompt g= ets shoved into the start of the line during a redraw when the previous com= mand=92s output lacks a trailing newline. This occurs only when two conditions are met simultaneously: 1. PS1 contains a visible multibyte character (like U+2A2F). 2. The prompt includes an escape sequence (like a color code) enclosed in \[ \= ] markers. If I use ASCII instead of the multibyte character, or remove the enclosed e= scape sequence, the redraw works perfectly. The bug only happens when both = elements are combined. I've verified this isn't a locale/width (UTF-8) issu= e. You can reproduce it interactively with: ``` PS1=3D$'\[\e[38;5;226m\] \u2a2f \[\e[0m\]' printf '%s' "$(seq -s/ 1 300)" ``` When the prompt is redrawn, the cursor backtracks improperly, causing text = corruption. To isolate this, I built Bash 5.2.21 (Readline 8.2) from source= on the same machine; it passes cleanly. The issue only appears after upgra= ding to Readline 8.3. I noticed this entry in the changes file talking about multiline prompts. D= oes that fix cases where the visible region contains a multibyte character?= If this is already resolved in development, please feel free to disregard = this. I want to archive a minimal reproducer on the mailing list just in ca= se. It was driving me insane Thanks for your work on Bash. groetjes! >JMN