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

Re: Why are prompt expansions of %v sequences quoted in bindkey style?



On Tue, Jan 23, 2024 at 7:44 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
>
> I missed that a 2nd expansion was needed in my example, but that is easy to work around.
>
> However, the quoting seems to make it impossible to use $psvar for anything involving control characters.

This is correct and I believe intended. I appreciate this feature for
what it is and find it very useful.

> Is there no way to work around this?

These are the options if you want to use \e[2m within the prompt:

1. A static PS1 with \e[2m embedded directly in the value without indirection.
2. The same as above but the value of PS1 is set in precmd and thus
can change from command to command.
3. prompt_subst

There are no other options that I'm aware of.

Roman.




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