From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 469 invoked by alias); 24 Mar 2016 01:53:28 -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: 21401 Received: (qmail 2243 invoked from network); 24 Mar 2016 01:53:26 -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,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=WVCglHkqs7+mkf+y5xG9X69v8XxN1uFMRQvZCXLL40A=; b=LvcHi76mkdtP5NZlxRosmT9KhjDYarHJFnyF5gQNLftixEk4dSUgiMv8K22oBAvOeg pRdZDmeclggy7TgeiU0EtWfoiPU+LWvGCb3CWFe6Al0lWo6JuaIztbErotxI6Zjos36v 8gPNR8NnJVCGh1PxRJ+6VFskWea/6nsyy6AxaaBNmZh/e52N+Td2cf+ro3byvokNW97X S7xcFrdCWCfIyL/Wv6Z4OVOInIxWDPGLHv8V9mN6NKHtOUF0siSx7xz5RKlCruWaf/a8 p69G50ryb0LK9pH65Ph0bnHCSzW5RLq+bD015Zqyk6Qrbyyyi+SQvgNKH6hDZaCf1KF7 VydQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=WVCglHkqs7+mkf+y5xG9X69v8XxN1uFMRQvZCXLL40A=; b=HGaAYX7hDycgKTHTSFC1SXH5TnCVPRlZu6HzxAfEQKXMinpP/rTF5vILvYEOoWVpvC BxoI0yX9H++tdAYH+iurVbB1P3QSHcJsgGjilAIwGvd1HnPPDxc/LwDq8JObPZZH8siw 6B4AItsrLzr5AMb4SZRYGhxu47D/n8LBQ3hAUSVIsFfb46dypbpPzUwK21a1is5XQFgF oiGi01K5N+QFHRPpvclW39wCNK0IdaIwvmb67XM2zk/Sh00vFQY8XjrFBPZndwR2D2It e+9tsEyoyg+sixYtOp0fZoAIeZEgTcos9Vk0e76Nlzg5VA4H1ICmP40q82PH9JV8jbsW A7gA== X-Gm-Message-State: AD7BkJJnn0DvWT7LmEjOVLFQJpJt0vfqYggCE3mnDnWn+0SCQjzePL4Rnuogu1W6j+3MCg== X-Received: by 10.98.72.29 with SMTP id v29mr8700950pfa.71.1458784401602; Wed, 23 Mar 2016 18:53:21 -0700 (PDT) From: Bart Schaefer Message-Id: <160323185356.ZM2458@torch.brasslantern.com> Date: Wed, 23 Mar 2016 18:53:56 -0700 In-Reply-To: Comments: In reply to Mikael Magnusson "Re: End boldface also ends background color" (Mar 22, 10:00pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: End boldface also ends background color MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 22, 10:00pm, Mikael Magnusson wrote: } } 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. The code for this in prompt.c is interesting: case 'b': txtchangeset(txtchangep, TXTNOBOLDFACE, TXTBOLDFACE); txtchangeset(txtchangep, TXTNOSTANDOUT, TXTSTANDOUT); txtchangeset(txtchangep, TXTNOUNDERLINE, TXTUNDERLINE); txtunset(TXTBOLDFACE); tsetcap(TCALLATTRSOFF, TSC_PROMPT|TSC_DIRTY); break; If you look at zsh.h where the TC* flags are defined: #define TCBOLDFACEBEG 18 #define TCSTANDOUTBEG 19 #define TCUNDERLINEBEG 20 #define TCALLATTRSOFF 21 #define TCSTANDOUTEND 22 #define TCUNDERLINEEND 23 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. In any case this code pre-dates the ability to set colors with %F by several years, and probably wasn't updated when %F was added. Given that the color attributes are stored in the txtchangep set, it should be possible to turn them back on after TCALLATTRSOFF disables bold, if somebody who *does* know how this works wants to dive in. Aside: 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.