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

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



On Thu, Aug 11, 2022 at 12:24 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Thu, Aug 11, 2022 at 4:37 PM Roman Perepelitsa
> <roman.perepelitsa@xxxxxxxxx> wrote:
> >
> > I like this patch [...]
>
> I should've said that I like the idea behind it. The patch implements
> one part of it. To complete the implementation percent expansion needs
> to output \001 and \002.

That's easy. The current code in prompt.c uses Inpar and Outpar, which
are 0x88 and 0x8A respectively. If instead we do:

#define invis_start ((char) 0x01)
#define invis_end   ((char) 0x02)

And replace Inpar/Outpar with invis_start/invis_end the code should
behave identically (since those characters are removed).

Then in promptexpand() we simply not remove them.

I'm not sure if leaking these characters is what we want though.

-- 
Felipe Contreras




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