From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3793 invoked by alias); 22 Mar 2016 21:00:46 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21399 Received: (qmail 5279 invoked from network); 22 Mar 2016 21:00:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=Uzni51GYWyb/Lf6aUqc0coWcbILLbgdr59oInAaMzmU=; b=JladpX29K6K+6aBkXDQ51TpzVe0wrSdU1a7wBvofCkP2N66TdREjj3g7f9L5YTj+ja Ja/fuKnTykf83CdU0Wk6jGT6AtVvZ7OYI6fSQGlnRkbN09AvjMRJkZDhvqAK/A7naf/F wYOZEe6tI2xfiOaSSpO2f5XkK5HlJxJS++Xzb4RmchYbDdrGoGrp7IZMbyi82azq1b+5 +7YBCFwGlCHWZLtA8Xp8A85470UOhT+RxoEPSa7LE68t5g1JWxrUpVWBsmOyCT4OVGoC E8GqnelLf3mlge+YAFXnHYDlXuuNLsPG470j0JmdWelrPacp88/MPXjFHa0Weaq3WpQ/ 0cig== X-Gm-Message-State: AD7BkJKjd96lMr98rBMbQ1wkS5qiNKE17483ot8vmyXe3D6p6iM5dhyGGd0DfVc9afuPt7tkOGRQSs6RCWQwtw== MIME-Version: 1.0 X-Received: by 10.55.203.23 with SMTP id d23mr51144524qkj.25.1458680440284; Tue, 22 Mar 2016 14:00:40 -0700 (PDT) In-Reply-To: References: Date: Tue, 22 Mar 2016 22:00:40 +0100 Message-ID: Subject: Re: End boldface also ends background color From: Mikael Magnusson To: Dominik Ritter Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On Tue, Mar 22, 2016 at 8:44 PM, Dominik Ritter 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