From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: print color escapes
Date: Wed, 31 Dec 2014 22:35:06 -0800 [thread overview]
Message-ID: <141231223506.ZM26289@torch.brasslantern.com> (raw)
In-Reply-To: <54A4DF80.7040206@eastlink.ca>
On Dec 31, 9:47pm, Ray Andrews wrote:
}
} tried various things, but can't find a legit way of printing the values
} of the color escapes. How should it be done?
You probably want either ${(V)fg[cyan]} or ${(q)fg[cyan]}.
torch% print -r ${(V)fg[cyan]}
^[[36m
torch% print -r ${(q)fg[cyan]}
$'\033'\[36m
} I'd expect 'print
} -r' to 'stay literal' with the expanded variable but no luck.
It is staying literal with the expanded variable. The variable has a
literal escape (ascii 033) in the value, not the string backslash e,
so print -r emits that literal escape etc. It's the terminal that
then turns that into a color, not the print command.
next prev parent reply other threads:[~2015-01-01 6:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-01 5:47 Ray Andrews
2015-01-01 6:35 ` Bart Schaefer [this message]
2015-01-01 19:24 ` Ray Andrews
2015-01-01 21:29 ` Bart Schaefer
2015-01-01 23:02 ` Ray Andrews
2015-01-01 23:26 ` Bart Schaefer
2015-01-02 2:30 ` Ray Andrews
2015-01-02 2:45 ` Kurtis Rader
2015-01-02 3:50 ` Ray Andrews
2015-01-02 4:18 ` Bart Schaefer
2015-01-02 17:43 ` Ray Andrews
2015-01-02 1:21 ` Kurtis Rader
2015-01-02 2:39 ` Ray Andrews
2015-01-02 2:58 ` Kurtis Rader
2015-01-02 3:48 ` Ray Andrews
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=141231223506.ZM26289@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--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).