From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: End boldface also ends background color
Date: Thu, 24 Mar 2016 10:38:37 +0000 [thread overview]
Message-ID: <20160324103837.678f2f36@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <160323185356.ZM2458@torch.brasslantern.com>
On Wed, 23 Mar 2016 18:53:56 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> There's no TCBOLDFACEEND, which I presume is why %b resorts to turning
> off everything. But I don't know much about how the txt* macros work.
The bottom level of this, where it feeds into termcap, is
settextattributes() in zle_referesh.c:
if (txtchangeisset(atr, TXTNOBOLDFACE))
tsetcap(TCALLATTRSOFF, 0);
Even in terminfo there doesn't seem to be exit_bold_mode, unlike
standout, reverse and underline (though it looks like standout maps to
reverse here).
If you look at the definitions, you'll see that \e[1m turns on bold,
\e[7m reverse, \e[4m underline. The definitions mapping to exit reverse
and exit underline are \e[27m and \e[24m. Nothing maps to \e[21m that I
can see. It works on some terminals, I used gnome-terminal:
print -P "first%Ufoo%{\e[1m%}bar%{\e[21m%}more%ulast"
However, that didn't seem to work on xterm (a few years old), so
apparently we can't assume it. We could make it an option, but that's a
bit of a pain. Short of that, it's not going to work without rewriting
the code substantially to track the current mode as well as the modes
that need changing.
> The doc for %F references zle_highlight which implies that you should
> be able to do %F{bold} but that doesn't work, and the numeric color
> values supported are not the ANSI color attributes. The doc should
> probably be tightened up to reflect this.
No, they're not the same thing, though we do make use of termcap for
colours where available.
pws
next prev parent reply other threads:[~2016-03-24 10:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 19:44 Dominik Ritter
2016-03-22 21:00 ` Mikael Magnusson
2016-03-24 1:53 ` Bart Schaefer
2016-03-24 10:38 ` Peter Stephenson [this message]
2016-03-24 14:53 ` Danek Duvall
2016-03-24 17:26 ` Bart Schaefer
2016-03-24 18:08 ` Danek Duvall
2016-03-24 17:21 ` Mikael Magnusson
2016-03-24 17:33 ` Bart Schaefer
2016-03-24 17:39 ` Peter Stephenson
2016-03-24 18:00 ` Bart Schaefer
[not found] ` <20160324103837.678f2f36__45846.6877033517$1458816008$gmane$org@pwslap01u.europe.root.pri>
2016-03-24 18:20 ` Stephane Chazelas
2016-03-24 21:34 ` Bart Schaefer
2016-03-24 22:43 ` Mikael Magnusson
2016-03-25 0:23 ` 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=20160324103837.678f2f36@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.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).