From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18082 invoked by alias); 24 Mar 2016 17:22:06 -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: 21404 Received: (qmail 12001 invoked from network); 24 Mar 2016 17:22:05 -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=JjQyBn6hcdzlKZyvktuM7Plrd5U0BVEeF4kGx3dykUA=; b=hsWMF8MxqtBVSPUFveUu7gPExlomDiv4H46UudcvG8RavPIw1AuvoCKP2DDkVoiOp0 JXtnZqMs8Mh5xfoqsVssp6qAEdJjTBVVw/50dd1cpqwCOhi9oMRSBlGAFAYrxWq7rc/i ddEYYKVpACn9lKxA8nX6tHUDe3KDlO8pu/rlsXr/wAJEnVx3JZNbqiVXMLZi/8uJZuzR pXfaIyVE2N12U/F6jMfQQofeYnBGfbQYdatThgQptcRX3GwWtFexVdkkH7irwRvlO2iI dRUZmOHbtX7Fx9d0I4o4MAnQMtFMDAlxlqj7uoT5coU2r0kXJ+TFXMurnEz6jEpMti8a /QfQ== 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=JjQyBn6hcdzlKZyvktuM7Plrd5U0BVEeF4kGx3dykUA=; b=CfxJaeJIC/kbgXAT7goslWwjCEd1TlkdaFOB3/apP7PCHNJfKmeL4fGOQ2uMawQl3K 8uktSKEXw8QmUVFqCGbVg/JtamLN3YvXuDO+LpeGp1QcQbrdIL8w0sM8ux66M5/Nv4HM 4k1/ecKUIhC9VfYIOe7LTVGpt6MAA8F1HMbTshRP7KaeoLiUUlU7mBLTdnywWm7uJg+Z QgujkgPVzDLDcUfJlWXuDknijnaf1kBWg3Ii0dV3LjUJARlx2VRxcFi+40wtd4XPTh56 dFZ0zdrIBVrXj46vlZKUVYcuJXaiianNLw90HV3MRh0CopjWedFCVac2MIUnGKKi9y02 CjfQ== X-Gm-Message-State: AD7BkJIA09/iQFodB0E4IuPCdgfAMTzXaL+CrMoWlx403kFXiq+v1yyT8x0HrQDfpbazDah64R0oXKGpkuPuJA== MIME-Version: 1.0 X-Received: by 10.140.132.68 with SMTP id 65mr12821768qhe.13.1458840119821; Thu, 24 Mar 2016 10:21:59 -0700 (PDT) In-Reply-To: <20160324103837.678f2f36@pwslap01u.europe.root.pri> References: <160323185356.ZM2458@torch.brasslantern.com> <20160324103837.678f2f36@pwslap01u.europe.root.pri> Date: Thu, 24 Mar 2016 18:21:59 +0100 Message-ID: Subject: Re: End boldface also ends background color From: Mikael Magnusson To: Peter Stephenson Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On Thu, Mar 24, 2016 at 11:38 AM, Peter Stephenson wrote: > On Wed, 23 Mar 2016 18:53:56 -0700 > Bart Schaefer 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. Like I wrote in my first reply, 22 turns off bold in most terminals, but termcap doesn't include it. ctlseqs.txt says Ps = 2 2 -> Normal (neither bold nor faint) Ps = 2 4 -> Not underlined Ps = 2 5 -> Steady (not blinking) Ps = 2 7 -> Positive (not inverse) Ps = 2 8 -> Visible, i.e., not hidden (VT300) and as you say, nothing maps to 21. I don't know why termcap doesn't include the bold-off code. >> 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 -- Mikael Magnusson