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

Re: PATCH: highlight groups (was Re: Why are prompt expansions of %v sequences quoted in bindkey style?)



> On 25. Jan 2024, at 0.41, Oliver Kiddle <opk@xxxxxxx> wrote:
> 
> The following is something which I've been intending to add since the
> attribute code refactoring from a year ago which added support for
> italic and faint without adding new prompt escapes. The hardest part
> of adding those now would be finding unused available letters and a
> separate abstraction layer for visual attributes is rather more useful.

Regarding the problem of finding unused letters: Perhaps you could create an EXTENDED_PROMPT option that enables using multi-letter escape sequences? It would make prompt escapes much more readable if one could use an actual word or at least more than one letter for each. For example, it would be more readable to able to write “Background” or “Bg” instead of “K”.

Having an associative version of $psvar would also help a lot, especially if %v sequences would expand first and then all other sequences afterwards. It would essentially let you create your own escape sequences. Here’s a trivial example of what I mean:

psvar=( dir '%F%~%f' )
PS1='%v{dir}%# '

That would make it so much easier to both read and modify prompt strings.





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