zsh-workers
 help / color / mirror / code / Atom feed
From: Marlon Richert <marlon.richert@gmail.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: highlight groups (was Re: Why are prompt expansions of %v sequences quoted in bindkey style?)
Date: Thu, 25 Jan 2024 11:12:32 +0200	[thread overview]
Message-ID: <018EC426-E674-4EFF-9F5F-375CD67E6AA7@gmail.com> (raw)
In-Reply-To: <16378-1706136069.980168@UYJb.QT-b._wqn>


> On 25. Jan 2024, at 0.41, Oliver Kiddle <opk@zsh.org> 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.



      reply	other threads:[~2024-01-25  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAHYJk3R8cpPSrNQOk8tnwz6bVYFVTfpJHz_DeFiYmCKHu880_Q@mail.gmail.com>
     [not found] ` <35F0FA32-34D7-4BF6-978D-EBFC2427ABE8@gmail.com>
2024-01-24 22:41   ` Oliver Kiddle
2024-01-25  9:12     ` Marlon Richert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=018EC426-E674-4EFF-9F5F-375CD67E6AA7@gmail.com \
    --to=marlon.richert@gmail.com \
    --cc=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).