From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 0be42b10 for ; Fri, 1 Feb 2019 03:41:09 +0000 (UTC) Received: (qmail 10382 invoked by alias); 1 Feb 2019 03:40:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44031 Received: (qmail 19559 invoked by uid 1010); 1 Feb 2019 03:40:53 -0000 X-Qmail-Scanner-Diagnostics: from mail.majutsushi.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(185.26.124.105):SA:0(-2.0/5.0):. Processed in 2.627884 secs); 01 Feb 2019 03:40:53 -0000 X-Envelope-From: jan@majutsushi.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=majutsushi.net; s=mail; t=1548992445; bh=D81LZmV+91SkD/jfOh9i0EolqZkfSv43i6mDTX0fB6c=; h=Subject:To:References:From:Date:In-Reply-To:From; b=ALogc9YHmLVO1iNPZcHZeEm6ZgHIxEvHb8iabUpO8ydrm4So3S3HCoS/8Tjqf3FX/ Gw0xXkSjA0Io2xJ5GVpIZ6TR3QEFTvDEoeE36Uzg0tAF9KXHLMwc5rfW7Lb8nunrhN PwR7DHYhGMjyge1TtAzEwtxzKCN47bYrBJSP4fdSTU+Ri9dIreGctnXlJsNqlUCRc3 +7zGpRtiMunr/jgOkj1SOEpYdJcrrD/Pep7LDcXpP2rEkUuaF/4OTelwZpwFAZLxf0 87MvRdJuYolpjR3M/92hQu8aYRjI+M+NmGkrEPOFALmtYCHxt9v/N93keuQ4NqeuHo 3sLCDTrIc+mLQ== Subject: Re: Small zle_highlight regression in 5.7 To: zsh-workers@zsh.org References: <6e542e69-1e09-1af7-0c68-8af456dd043e@majutsushi.net> <7CC43B0E-687B-4C5A-9306-92F05C431406@dana.is> From: Jan Larres Message-ID: Date: Fri, 1 Feb 2019 16:40:41 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <7CC43B0E-687B-4C5A-9306-92F05C431406@dana.is> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Odd, I wonder where I got the idea that 'reset' was the correct thing to use then. I think that's some old relic that I haven't really looked at in years. I also missed the mention of 'default' somehow. Using 'default' does make it work for me though, so thanks! -Jan On 01/02/2019 14:46, dana wrote: > On 31 Jan 2019, at 17:31, Jan Larres wrote: >> In 5.6.2 I was able to use the special 'reset' foreground attribute ... >> This doesn't work any more in 5.7: ... >> I also can't find any mention of this attribute in the documentation any more. > > I don't think it was ever there — the documented way to do this is %F{default} > or simply %f. %F{reset} only worked because unrecognised colour names would > just fall back to the default sequence (which doesn't seem to be mentioned > explicitly anywhere?). > > 5.7 did change that, though, and i'm not sure it was intended. > > This seems to fix it > > dana > > > diff --git a/Src/prompt.c b/Src/prompt.c > index 4603ffba6..f2b3f161e 100644 > --- a/Src/prompt.c > +++ b/Src/prompt.c > @@ -1661,10 +1661,12 @@ match_colour(const char **teststrp, int is_fg, int colour) > colour = match_named_colour(teststrp); > if (colour == 8) { > /* default */ > return is_fg ? TXTNOFGCOLOUR : TXTNOBGCOLOUR; > } > + if (colour < 0) > + return TXT_ERROR; > } > else { > colour = (int)zstrtol(*teststrp, (char **)teststrp, 10); > if (colour < 0 || colour >= 256) > return TXT_ERROR; > > diff --git a/Test/D01prompt.ztst b/Test/D01prompt.ztst > index 56b7c294a..7ff478e68 100644 > --- a/Test/D01prompt.ztst > +++ b/Test/D01prompt.ztst > @@ -221,3 +221,11 @@ > print ${(%U)Y-%(v} > 0:Regression test for test on empty psvar > > > + > +# Unrecognised colour strings should produce the default sequence > + f=${(%):-'%f'} # Recognised > + Fdefault=${(%):-'%F{default}'} # Recognised > + Freset=${(%):-'%F{reset}'} # Unrecognised > + Ffoo=${(%):-'%F{foo}'} # Unrecognised > + [[ $f == $Fdefault && $Fdefault == $Freset && $Freset == $Ffoo ]] > +0:Regression test for workers/44029 >