From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7894 invoked from network); 25 Oct 2020 21:30:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Oct 2020 21:30:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1603661410; b=dNYLQky3nInGd60J6gvQULZu5t1tp8vZNShhjm7ZWlxLN2sVksw1fvHdc2/EV2bJG2rNmIF6TU Gt/Quzakk0c0Jyb+l7pE8oHB6O8zEgWyokj3gA5aciBfruol4a3sX2Gou2NEYfqRpNsymWljyF ZB2IxKgMrjEyYudfo3UgNlKm1tWTa4e9uBe/o+aCDH3fiH4Q9JDusSz8+YtZDJaXdUHI93IOj8 jStVbFTZI9EesvS5GbYxIE/r8OTRTIP5ACnJjrxywmTOOjguIlerJEfoGqga2a1jYT2jc5uIxs kjmT9wgCBobfxH4zgVdHafyUz/ouQokTOWR4OLdj9E2ucw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f68.google.com) smtp.remote-ip=209.85.166.68; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1603661410; bh=AdWRecdJuh+zwMgcGC5Y8PCI4O/D2gfgGu4hyYCNyPE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:References:In-Reply-To:MIME-Version:DKIM-Signature: DKIM-Signature; b=vTHDAda5cnWiJ4Wa0UD+A4wqp1Ay/Tj9DzqRG/ILc4dqifXZ8zzhNm85nAOZAy0gbfrqoz/arD 3y9xCo+wyKV6RXUTOn3ECZ8PrsyQ2KL+sgJRe+3/qu9PQq1jUdkMwrnxot8ft56vstCXA/8ER/ VTuLtPOhq8R70K7UXPtZNzGhHagOuxm9TiuYwyXVRab/AuoEew5L++uLADDj7/J4Hcg/cguuYF t4gdDP0CxQe4Hx8XWz8J27kbKY8eeeMtScHjAEkqLQQUaH4XHssIO0KXIf4+DuRAQ22plZGqr2 w/A1s3wWcLCTKJUI8LHxJ6QdqOwGxki6WYjE/yXfpWsoig==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:References:In-Reply-To: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=6klY71IRhhD+kZQbaZrOv3GB1tYEV+zgB1GD0nhqu6Q=; b=UiMKI+bYUeS2zJS5RTn7SKLSyQ J66OCqvMrZTVZeptMycwALu2eAkdXBDhFGklx9RGl/mWCHykRiHNoR2OLjclWdqxFiJtNAVG9UWug 5zXP4djCjhZWRiqY1wJzrXNe8eXjvgQayrlXOTJ8Qb05/Bsjpavuic8rhqW5+75kkAAtJ/W2e3B97 nbbyAHMhtN0kz8U4VfpSBhN7sbKyA7oNhibTlnZEd5ydxtHtpZEOXSYcCILM0/Wz/XF3Z3s7XZaFI AUv2VL1VCfaweB6siGX7CDudQ19s6AQaxz6vZPZaJcaNl5IDDGE7elWGvpcnD5r73Fjg7CAjtIJ/n MIfktoXA==; Received: from authenticated user by zero.zsh.org with local id 1kWnaY-000Dfj-U4; Sun, 25 Oct 2020 21:30:06 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f68.google.com) smtp.remote-ip=209.85.166.68; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-io1-f68.google.com ([209.85.166.68]:42269) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kWnaE-000DUc-M5; Sun, 25 Oct 2020 21:29:48 +0000 Received: by mail-io1-f68.google.com with SMTP id k21so7893566ioa.9 for ; Sun, 25 Oct 2020 14:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6klY71IRhhD+kZQbaZrOv3GB1tYEV+zgB1GD0nhqu6Q=; b=CvDFYc7LVONiEL60xB75PwQEwdPmpp9i7m9yKsC6cBJUlm7i3bWjqquT9eXnuyNGQd C7A+Ebud4PDGc8wqoQAexvPEZY/5M/JkmFDxGnK/ETB/U0E1oF2Iz4TMjbz/Ae+BZQjs fpLiTsGynQ900vzpMlfWgu2iV3naZThIanG0DjZzETUaZF4YcJ2V2NKK+9+z+CHZDpgK w+yQgvRGl6AS5sh1CziUZ04BeWuHezKr2DVP8WY1rHByb45wLcqYyCOLp09w8n5LXkRC BWF+xXW+RZumF/Bb9N0wOJ+LiQI7Kxe/1tXqv4q4GYIz86xwvQIzqwiX0LPYRRifZi2V avbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6klY71IRhhD+kZQbaZrOv3GB1tYEV+zgB1GD0nhqu6Q=; b=UP44dCno0P1WI5lZhNS00zEbykR2aCyZxU/wy5snqO1Wu2DXCywjuD0zZs4mM+7GE9 d31E4WDYzUGHimw6Zb/KpSkrkDBnz2RPBqjIBk2mLfvsvffPICCd1RXg4W4C0RmpPUXS jD1Oc4ELBtHaPkBhElPSSs2ENLDVR6wBJqvpZT5fScGYMtfGITA2Ed4OZ4olrJeJBZe7 pqKRwNSI+Y7tXOsyMA4C6oZs+tdxzyeExfgtcgJkQHS1DYwUzF1onIoEnleoYWYvmFiz gOwCJQ5jDUIpHBpZSkPDEktt7569WX5pcRD8tyBn/La7sdwvs1QjZlq+bFPDC1te6+g/ XvjA== X-Gm-Message-State: AOAM531Z49Tbxrv1ND0JkuPm6guA1udAcYni1eP7lZOLOV3bVk4hFWTA FfJ//8r6Fil0bd/g56B0SYcSg4By/VIK64+pKr/7dKan X-Google-Smtp-Source: ABdhPJzLSa9tP5tV5JRZ5/tiYGprutOmXjFOjsxInhfdP6xovLlhbiGhtQZQuL1EOVAqP3u4yL8hkVv7qRQtZkxvYxY= X-Received: by 2002:a05:6638:f81:: with SMTP id h1mr5073346jal.115.1603661385443; Sun, 25 Oct 2020 14:29:45 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:1b03:0:0:0:0:0 with HTTP; Sun, 25 Oct 2020 14:29:44 -0700 (PDT) In-Reply-To: <20201025201219.24ef0ddc@tarpaulin.shahaf.local2> References: <20200830111346.xulnbxoqxduetnoz@chazelas.org> <20201025201219.24ef0ddc@tarpaulin.shahaf.local2> From: Mikael Magnusson Date: Sun, 25 Oct 2020 22:29:44 +0100 Message-ID: Subject: Re: [regression] %2K prompt expansion no longer works To: Daniel Shahaf Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 47502 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On 10/25/20, Daniel Shahaf wrote: > Mikael Magnusson wrote on Sat, 24 Oct 2020 16:21 +0200: >> On 8/30/20, Stephane Chazelas wrote: >> > $ print -rnP %2K | hd >> > 00000000 1b 5b 34 30 6d |.[40m| >> > 00000005 >> > >> > %K{2} is fine: >> > >> > $ print -rnP '%K{2}' | hd >> > 00000000 1b 5b 34 32 6d |.[42m| >> > 00000005 >> > >> > Introduced by worker:30496 >> > (https://www.zsh.org/mla/workers/2012/msg00421.html >> > 8a9b141652a0e4157056dc21e36a64ac712a7ee7 git commit). >> > >> > Oddly, the comment there: >> > >> >> Well, nobody objected so here's a version with de-duplicated >> >> code. The previous patch broke %K, but it works now (passed 1 >> >> for is_fg on both paths). >> > >> > Actually describes the bug here. Looks like Mikael just missed a bit i= n >> > that >> > fix. >> > >> > Should be fixed with: >> > >> > >> > diff --git a/Src/prompt.c b/Src/prompt.c >> > index bc9734720..997327e18 100644 >> > --- a/Src/prompt.c >> > +++ b/Src/prompt.c >> > @@ -258,7 +258,7 @@ parsecolorchar(zattr arg, int is_fg) >> > bv->fm--; >> > } >> > } else >> > - arg =3D match_colour(NULL, 1, arg); >> > + arg =3D match_colour(NULL, is_fg, arg); >> > return arg; >> > } >> >> Just noticed that these [unposted] testcases don't pass. Added some >> debugging prints and it turns out that %F{green} uses a different code >> than specifying the number. Eg, >> >> echo $F1 $F2 $F3 $F4 | cat -v >> >> results in >> >> ^[[38;5;2m ^[[38;5;2m ^[[38;5;2m ^[[32m >> > > Isn't this what Oliver just pointed out in another thread? =E2=80=94 > > Oliver Kiddle wrote in 47491: >> Regarding (1), I just noticed that a new D01prompt test case is failing >> on FreeBSD because ${(%):-%F{2}} is not producing the same as >> ${(%):-%F{green}}. This is a new test added just last month in 47352. >> >> This is down to TXT_ATTR_FG_TERMCAP being set for 2 but not for green. It is, I'm not reading that thread though :). --=20 Mikael Magnusson