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.
The \[ and \] escapes only matter to readline, so it's reasonable to ignore
them for PS0 and PS4 (though it makes no sense to include them in $PS4,
at least). Bash already ignores them when line editing isn't enabled.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/