zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Dominik Ritter <dritter03@googlemail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: End boldface also ends background color
Date: Tue, 22 Mar 2016 22:00:40 +0100	[thread overview]
Message-ID: <CAHYJk3S_837wMcu0VgFkuWmrFsmdGT6Tqg4euxvjky=8HOfuGA@mail.gmail.com> (raw)
In-Reply-To: <CAJjRh0RPasUzjZr+RFmdTGZLs_gpgx7fb3XjT9uEOSAtpNmgCA@mail.gmail.com>

On Tue, Mar 22, 2016 at 8:44 PM, Dominik Ritter
<dritter03@googlemail.com> wrote:
> Hi List!
>
> I have a Problem regarding boldface mode. If I change the background
> color of a string, and want to set a part of that string in boldface,
> the background color gets ended as well.
>
> Example:
> print -P '%K{black} %F{white}%Bhello%b world'
>
> The boldface ending sequence, also ends the background color. So only
> "hello" gets printed white on black, "world" gets printed in white
> (without background).
>
> This seems like a bug to me.. Anyone else can confirm that?
> Btw. I am on ZSH 5.2 (latest homebrew).
>
> Of course, there are some workarounds:
>
> - Start the background color again, after ending boldface.
> Well. Possible, but quite verbose.
>
> - Use $fg_bold[white] and $fg_no_bold[white] instead of %B and %b.
> Also quite verbose..

The code for ending bold sequences is usually ^[[22m but %b sends
^[[0m which resets most things. As far as I know, termcap
unfortunately doesn't include the code that only ends bold, so there's
no way for zsh to know what it is. Zsh doesn't hardcode any of these
sequences because they can vary across terminals.

-- 
Mikael Magnusson


  reply	other threads:[~2016-03-22 21:00 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 [this message]
2016-03-24  1:53   ` Bart Schaefer
2016-03-24 10:38     ` Peter Stephenson
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='CAHYJk3S_837wMcu0VgFkuWmrFsmdGT6Tqg4euxvjky=8HOfuGA@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=dritter03@googlemail.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).