bug-bash
[Top][All Lists]
Advanced

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

Re: PS0 vs. \[ \] followup


From: Chet Ramey
Subject: Re: PS0 vs. \[ \] followup
Date: Fri, 12 Jun 2026 12:58:00 -0400
User-agent: Mozilla Thunderbird

On 6/10/26 6:21 PM, Koichi Murase wrote:

I can agree that the current behavior is one possible consistent
behavior, but could you take this as ``a feature request'' for another
consistent behavior? That is, the removal of \x01 and \x02 is
performed at the very last stage so that the behavior of the
`promptvars' processing of PS0 and PS4 is unaffected.

I responded to this in a subsequent message. I didn't really respond here
because the request represents a fundamental misunderstanding about
how \[ and \] work, and where the \1 and \2 markers are `removed',
and what you really want is some dummy separator character you can use at
the end of the supplied PS0.



If you think it is not consistent with `the --noediting PS1', I think
one can switch the behavior depending on `--noediting'. If line
editing is disabled, \[\] may produce an empty string from the
beginning. Otherwise, \[ and \] produce \x01 and \x02, which will
later be properly processed or removed at the final stage.

I don't think adding new code to strip \1 and \2 from prompt strings that
aren't going to be passed to readline is a useful addition.

--
``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/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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