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

Re: Turning display attributes on / off in prompt strings



On Fri, Dec 16, 2022 at 4:45 PM Oliver Kiddle <opk@xxxxxxx> wrote:
>
> Bart Schaefer wrote:
> > you can't mix in "raw" sequences for attributes that prompt.c
> > doesn't "know about"
>
> It can also get confused when you assign the results of ${(%)...} to a
> variable without printing the results.

A consideration is that if we simply replaced $"\e[m' with $'\e[24m'
and so on, the present prompt code would still emit the
then-unnecessary sequences to restore the other attributes.  Is it
worth the effort to rework that?

> I'd be reluctant to create an extra setopt without first having evidence
> that terminals that need it are still in use.

Agreed, I was excerpting Mikael mostly for "would [not] lose a lot of
compatibility".

> And if we need a way to
> override terminal settings, something more generic may be better.

Would populating a writable special hash parameter be a security issue?

As you implied, though, the hash key names could be tricky to choose.




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