From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19977 invoked by alias); 24 Mar 2016 10:38:48 -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: 21402 Received: (qmail 19791 invoked from network); 24 Mar 2016 10:38:47 -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 autolearn=ham autolearn_force=no version=3.4.1 X-AuditID: cbfec7f5-f792a6d000001302-c4-56f3c3b159f4 Date: Thu, 24 Mar 2016 10:38:37 +0000 From: Peter Stephenson To: Zsh Users Subject: Re: End boldface also ends background color Message-id: <20160324103837.678f2f36@pwslap01u.europe.root.pri> In-reply-to: <160323185356.ZM2458@torch.brasslantern.com> References: <160323185356.ZM2458@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xa7obD38OM+ifLGux4+RKRgdGj1UH PzAFMEZx2aSk5mSWpRbp2yVwZfS/nc5esIanYuoEgwbGH5xdjJwcEgImEl1fTjNC2GISF+6t Z+ti5OIQEljKKDH71TMmkISQwDQmiZ5t6RD2OUaJOZ+cIYrOMkpMWLYNrIhFQFXi35fZzCA2 m4ChxNRNs8GmiggoSpz59Q2sRhho293+XewgNq+AvcT7tl8sIDangKXEqjMvoDafYJTouroP bBC/gL7E1b+fmCDOs5eYeeUMI0SzoMSPyffAmpkFtCQ2b2tihbDlJTavecsMcam6xI27u9kn MArPQtIyC0nLLCQtCxiZVzGKppYmFxQnpeca6RUn5haX5qXrJefnbmKEBPPXHYxLj1kdYhTg YFTi4b3B9TlMiDWxrLgy9xCjBAezkgiv+CagEG9KYmVValF+fFFpTmrxIUZpDhYlcd6Zu96H CAmkJ5akZqemFqQWwWSZODilGhjvrPX/XLyH02i60t3EUim5Ws37D2+G7bh7dhXfzDqFkBXs 2/UzC39NknN/snLxgwkXL83j400teMZ4sZNvfVbVgUzJ2E3JWz2L3iz+8ONtSJB8U+6k5rXN FTdy2wrfuTN9ijPPNSydL2Bz6unsXycEvZaLPJ/NKW3FrXKh/rLlLd1ct2/bZhopsRRnJBpq MRcVJwIABYf3+WICAAA= 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. > 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