Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: End boldface also ends background color
- X-seq: zsh-users 21399
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Dominik Ritter <dritter03@xxxxxxxxxxxxxx>
- Subject: Re: End boldface also ends background color
- Date: Tue, 22 Mar 2016 22:00:40 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=Uzni51GYWyb/Lf6aUqc0coWcbILLbgdr59oInAaMzmU=; b=kOWeQ9MUBmZ+rTgkvfRjrt+G4jjzZ7vtVzEHS/Qv0bSyxu9C6f4M+sFSZVSVhRrFzh x3wdPp/LI5s2fQhffMoWY1bjbFWVqh1DROwuAbQU8HkG9F7OzlGHBeFx4kllVdZdE+b1 oCKCJeMCuriMMjvr2h/P8kKj4Ll8oc7+KeB9srVftKaH9ZbUW0jn6r90gtUY442SsKLA 7jTwrAzPGZ4BI2H17aqAvbO+Xz6SGnS77Po8iWu3nMzslaVN2jyuNX+iYDzf347wapbb h97o4rxoj+XjRmTD1MfuY8Qhnpzh9SvlSiVkF+ZjOWRh6AuNKUUDnmJejmsGk9p26dqK 2Tlg==
- In-reply-to: <CAJjRh0RPasUzjZr+RFmdTGZLs_gpgx7fb3XjT9uEOSAtpNmgCA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAJjRh0RPasUzjZr+RFmdTGZLs_gpgx7fb3XjT9uEOSAtpNmgCA@mail.gmail.com>
On Tue, Mar 22, 2016 at 8:44 PM, Dominik Ritter
<dritter03@xxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author