Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH v3 try2] prompt: support generic non-visible regions



On Tue, Feb 28, 2023 at 10:29 AM Oliver Kiddle <opk@xxxxxxx> wrote:
>
> Felipe Contreras wrote:
> > readline uses \001 (start of header) and \002 (start of text) as markers
>
> So the literal ASCII Ctrl-A and Ctrl-B characters and not the \001 etc
> strings, right?

Yes.

> The main concern I have with this is whether there definitely is no use
> of those two characters anywhere by any terminal for some other purpose
> such that some user somewhere has them already in their prompt?

If that was an issue, wouldn't bash users have already experienced it
in the years this code has been active? (or possibly decades)

Moreover, can we agree that it's at least extremely unlikely for this
to be an actual issue?

> And do we know they won't form part of some other future terminal
> sequence?

Once again, can we agree that's unlikely? (especially since bash
already uses these)

> We can find a special way to generate the literal characters but that
> only helps with future uses, not backward compatibility.

Like what? A setopt flag?

> I can understand the motivation to be able to support the lack of
> prompt_percent and perhaps both bash and zsh in some plugin or other.

I personally don't care about the prompt_percent stuff, somebody else
mentioned it. The usefulness of sharing prompts between bash and zsh
is what I'm interested in.

> > +     } else if(*bv->fm == 0x01) { // start non-visible characters
>
> For now, we've not, to my knowledge, bumped our requirements to cover
> C99, C17 etc so stick with old-style C comments in the code.*

OK. Will fix in the next version.

-- 
Felipe Contreras




Messages sorted by: Reverse Date, Date, Thread, Author