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.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,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 dc767fba for ; Fri, 1 Feb 2019 01:46:53 +0000 (UTC) Received: (qmail 8480 invoked by alias); 1 Feb 2019 01:46:40 -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: 44030 Received: (qmail 16307 invoked by uid 1010); 1 Feb 2019 01:46:40 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f174.google.com 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(209.85.166.174):SA:0(-1.9/5.0):. Processed in 2.257668 secs); 01 Feb 2019 01:46:40 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qc5FHCbs2XoWaUr2DPF4Iw9YwBAM+7mCY6UsYzFnBcU=; b=hDrFHie9/7bqZfE3faJ+SZiIsa/qs0y+hBRN7eIhWil1qPsgJNhu1aEk2lgMJAs7xB W3NmUyWqZyX30UpewZgmEg3m2EUxNrwfiV7AFW2ZAkqBxTd7Zv34y83MGk8zhF/QH2fM p0IZR9aE5lfsFOJdAcOiYjbOgeAG4aBRMJUyZKSGGualpGz4ui/BSFi114VoBhYPcQix t1fRcnQOO874OHc3BRiOhLJFFc4fQW9g5tEg6Oqp1OTvfPlGzB0DqbN9id4OgDaxYnSn OWxZ/L3c7zlHa7Gmd1I60PjYHLNKEn0a3P0EqIbeAYo6STIkluMwBFql/POwQLNZY1jx 3ttw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qc5FHCbs2XoWaUr2DPF4Iw9YwBAM+7mCY6UsYzFnBcU=; b=UK/rfmzkA/yNM1gJ16P/adcy6dtzQWqEjOwBZoMYJlyddimc4dCu10lWQqvBmMtBKC xEZRNc5xI26DzHMhKsTNz2xPaNroqc0RspCIuSKAm08GudJ/s1eO2zy8jCwn6PPBF7Qb GaQfZv6+QvvCcBLJDTDqN+/lJGNJMLFNqdOWt+9O4WP0PGE4Eh9gn1yXgi8sFUv4pX0N ipzzj8JdTBSFbQjveOGTAtG7b4sJtE2fKpFZZJNkB68Yx7PyiySulGFdERmI4PYH+R8x YXd+ibCdZgtJ7qfvDxc3RUfuij8BNiSXs0+i9RPhUlITwHJmFjH9oaJ23X/b+vsJ899Z WasQ== X-Gm-Message-State: AHQUAuZc5fxoswoEu0Cqf/hnXIfcMyqbApqbPytLfhqOFNUuF5IwYdyp PfkhZO28RfTjOVgr/7csEVsWygmkgDU= X-Google-Smtp-Source: AHgI3IbaX8UFRLHaeIRzz86WQNiKkOplBbjdrcaEeLP0tZt6GuZBqTDNmwqL76qo/rWbWwIGlKVGZw== X-Received: by 2002:a24:1c04:: with SMTP id c4mr269156itc.79.1548985595102; Thu, 31 Jan 2019 17:46:35 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: Re: Small zle_highlight regression in 5.7 From: dana In-Reply-To: <6e542e69-1e09-1af7-0c68-8af456dd043e@majutsushi.net> Date: Thu, 31 Jan 2019 19:46:33 -0600 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <7CC43B0E-687B-4C5A-9306-92F05C431406@dana.is> References: <6e542e69-1e09-1af7-0c68-8af456dd043e@majutsushi.net> To: Jan Larres X-Mailer: Apple Mail (2.3445.100.39) 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 =E2=80=94 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 =3D match_named_colour(teststrp); if (colour =3D=3D 8) { /* default */ return is_fg ? TXTNOFGCOLOUR : TXTNOBGCOLOUR; } + if (colour < 0) + return TXT_ERROR; } else { colour =3D (int)zstrtol(*teststrp, (char **)teststrp, 10); if (colour < 0 || colour >=3D 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=3D${(%):-'%f'} # Recognised + Fdefault=3D${(%):-'%F{default}'} # Recognised + Freset=3D${(%):-'%F{reset}'} # Unrecognised + Ffoo=3D${(%):-'%F{foo}'} # Unrecognised + [[ $f =3D=3D $Fdefault && $Fdefault =3D=3D $Freset && $Freset =3D=3D = $Ffoo ]] +0:Regression test for workers/44029