On 6/9/26 7:52 PM, Robert Elz wrote:
| For the original background, you can reference the URL at the bottom | of the original post.That's weird, I have no idea what it is attempting to achieve, and nodesire to find out.
The OP wants to embed a terminal escape sequence ending in \ into PS0. He also wants to allow people to append to PS0 without the trailing backslash potentially acting as an escape character for word expansion.
There will always be issues when there are 2 different expansion schemes happening at the same time (more or less) when one sometimes wants one before the other, and other times the other order, it is all just a giant mess.
Oh, I don't know. They've coexisted for 37 years now.
The issue is that, as I understand things, they aren't being removed at all - they simply are no longer being inserted where they once were, as they are not needed in PS0 or PS4 (in them, nothing there cares what charsin the string use char positions on the terminal, and which don't).
This is correct.
Any \[ \] in the string are simply deleted - and technically, perhaps even that shouldn't happen, as PS0 and PS4 don't need such things.
That was the other choice, but it would have left artifacts in PS0 and PS4 that are not left in PS1 or PS2.
| You seem to support | pre-`promptvars' removal in the current devel branch, but it actually | only removes the embedded markers halfway. To remove those markers, | including the ones emitted by command substitutions of a prompt | framework, one needs to remove them after `promptvars' instead of | pre-`promptvars' removal.
This is not a good idea.
As I understand it (and assuming that the absurd \ things are to remain in prompt processing) bash has long documented the order in which those happen. And that is, \ expansions first, var (etc) expansions second (if enabled).
This is correct.
ps: from what I gather, part of the issue is the desire to support ancient versions of bash, where promptvars didn't exist, and the \ expansions wereall that were available.
Not really. What happened was the `\' escape sequences came first, then
between bash-1.02 and bash-1.04 (July to September, 1989), we added the
ability to perform word expansions on the prompt strings. That feature was
gated by a magic shell variable ("NO_PROMPT_VARS"). When I introduced
`shopt' in bash-2.0, part of the reason for it was do get rid of some of
these magic variables, many of which were undocumented.
Any version of bash that people actually use has `promptvars'.
--
``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/
OpenPGP_signature.asc
Description: OpenPGP digital signature
