From: Bart Schaefer <schaefer@brasslantern.com>
To: Grant Taylor <gtaylor@tnetconsulting.net>
Cc: zsh-users@zsh.org
Subject: Re: Supporting %F{...} and %K{...} in Zsh 4.x
Date: Mon, 18 Dec 2023 11:28:39 -0800 [thread overview]
Message-ID: <CAH+w=7aqO1YD2aVCNvV1T6mk5=MbEq6sd5CDFxUYYora=OrJhA@mail.gmail.com> (raw)
In-Reply-To: <1aeaa93d-5d31-4ec0-956f-2de837de20ff@tnetconsulting.net>
[-- Attachment #1: Type: text/plain, Size: 556 bytes --]
On Sun, Dec 17, 2023 at 12:51 PM Grant Taylor <gtaylor@tnetconsulting.net>
wrote:
>
> I guess I could set the color codes in variables and use the variables.
>
Functions/Misc/colors from 5.9 (and even from git HEAD, currently) is
backward-portable to 4.2.x (again, tested on 4.2.6).
This may be useful:
coloresc() {
local codes=$(printf "%s;" ${(e):-\$\{color\["$^@"\]?oops\}})
REPLY=$'\e['"${codes%;}m"
}
Used like
coloresc bg-bright-blue bold white
it sets $REPLY to the escape sequence for the listed color combination.
[-- Attachment #2: Type: text/html, Size: 1094 bytes --]
next prev parent reply other threads:[~2023-12-18 19:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-17 19:42 Grant Taylor
2023-12-17 20:02 ` Roman Perepelitsa
2023-12-17 20:51 ` Grant Taylor
2023-12-18 6:57 ` Roman Perepelitsa
2023-12-20 5:50 ` Grant Taylor
2023-12-18 19:28 ` Bart Schaefer [this message]
2023-12-17 21:32 ` Bart Schaefer
2023-12-20 5:59 ` Grant Taylor
2023-12-20 16:58 ` Bart Schaefer
2023-12-24 18:25 ` Grant Taylor
2023-12-24 18:35 ` Bart Schaefer
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='CAH+w=7aqO1YD2aVCNvV1T6mk5=MbEq6sd5CDFxUYYora=OrJhA@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=gtaylor@tnetconsulting.net \
--cc=zsh-users@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).