bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PS0 vs. \[ \]


From: Egmont Koblinger
Subject: PS0 vs. \[ \]
Date: Fri, 15 May 2026 13:34:04 +0200

Hello,

The manual's PROMPTING section says that PS[0124] support a long list of
escaped characters, including \[ and \].

Actually, in bash-5.3.9, PS0 does not support \[ and \]. If these are
present in its value, their corresponding raw 0x01 and 0x02 bytes do get
printed, rather than getting eliminated.

In turn, most modern terminal emulators that I'm aware of ignore these
bytes. An exception I've found is Zutty, it prints replacement symbols,
causing unexpected visual result. I'm pretty sure there are other software
and hardware terminals as well where this can cause problems.

Obviously bash doesn't need to keep track of the columns for PS0, so there
these special characters are pointless. But being pointless doesn't mean
that they shouldn't work. Could the behavior please be made consistent
across the various prompt strings, and also matching the documentation?

thanks,
Egmont


reply via email to

[Prev in Thread] Current Thread [Next in Thread]