On Fri, Jun 12, 2026 at 6:58 PM Chet Ramey <[email protected]> wrote:

> the request represents a fundamental misunderstanding about
> how \[ and \] work, and where the \1 and \2 markers are `removed',

As far as I can see, this is again the difference between the
bottom-up vs. top-down approach I've mentioned recently.

I don't care where those markers are removed, nor should anyone else,
as long as it's consistent and reasonable.  Currently it's not.  The
process of removing them results in different strings depending on the
readline vs. noediting circumstance, this is neither documented nor
something that would make sense from a top-down view.

As someone who ships vte.sh, why can't I set up a prompt string that
works identically in these cases?  And also identically across
PS[0124]?


> and what you really want is some dummy separator character you can use at
> the end of the supplied PS0.

If the removal of these markers was consistent across these two cases,
it would coincidentally happen to be a great workaround for our
original problem.

Since it's getting unlikely that you'll do it, we'll look for a
different solution.


> 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.

You look at it as a piece of code with a certain low-level
functionality to be added somewhere.

I look at it as the proper means by which the readline vs. noediting
cases could behave identically.  The top-level goal being what
matters.  The stripping of those two bytes at their own designated
place being just the way to implement it.


e.

Reply via email to