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, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5789 invoked from network); 11 Aug 2022 19:35:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Aug 2022 19:35:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1660246547; b=pQcfWCSZ4j5ByKxPZa7LlykaAsAomK9WncZZ6qY2FTfLVme+Uw90V1IUFhf8rAKDwU54xonP9V GP7aWhhKEJUSLJzPkpL3MEnNodwnL9+2NWs3LscsBrX8+x4HtJCJTELnP2ULkRv5KHZU050YDr IfeR2jgHRkPrjtPl7uI/gxt6v9O7WtEB1EAgXpIJZeK7IeO2/UAx9Va+bjsYZbCcMitFfBgOt8 YIRs/3mv3igrZtvfuTasUQ4VrXpFJKMaq2VTveQrJvUh5bM9qDtOBC0fFDllsPTDr08aqfLdSb bAvxWWITime2ycwEQvvA6Gkg6bBhzqXPqN8G6C90wc6yQg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qt1-f172.google.com) smtp.remote-ip=209.85.160.172; dkim=pass header.d=gmail.com header.s=20210112 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-20210803; t=1660246547; bh=OCj096BHTiFhTdhSo4G67ROB9iUaTA1Vv263qGeBUa4=; 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:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=oNKtaBzVQVXsl7YoTxYHTGv8fdEQseSXmTM9KDtA6MUncRIh1xy3ukMyM/RvMErfKQlT6EE4oD GrTY6WiQ9KhlGSM2Vj9dd+eEhJbqTyf2DuCWqeS0KCKtxrW3zMC7QI8zlhTuXzjJrkRd0eBGHz YRG4IZjeA9k0CXTJlziFLSjyKJozaGLND9SCxTtDFmZj7uGl6tNdoGSQ3AezRTdA0mnVScAVSk wsfvPIKI1mnWGvAPHPbxHAoe8ua4JBzeSPQyAeHFY7onBIme4UOrZHf4ofBlj0kRHcj5agEalp RStJgGpEMt17xER+ue6ZQmLDDHpMoRSnBG4GdvTiKBdzjA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; 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:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=qdUiLT+S6KW/rhDMyJrRuImSbKHGAm4gEX2189ux6/g=; b=IZjlGp2owxYi/u7E4syXEPXeB3 d9Gg9y/3t0AHCi2N6b50WNjSM6MNU8UKManopAd/QpfJ9aAt7AeoEH8TBBjROj8u9YzVZoCW8c+iz IpuBOIawq0RLb+XHNMOp7WW4AqBwPPM4xcPaX8T4ZFXTcwbjlEvd8Hx+8aR/IDJhPZXb4zkUICkTP BWcnCFC4E2QIZPXERhN9ThIFznon8Vnm1MAXxfUReZQO21nOpltJi3TSqD3I4dNXb6rTGz1jnM+14 /BRTWNlREFMcyhDnIJTjTzNJf1d9vZ8EUgUdPFYrooQP57gtc4pYVmEWltTLVlsGM4D7yPVqFp0k3 fxE61xtQ==; Received: from authenticated user by zero.zsh.org with local id 1oMDy6-000Lrt-TJ; Thu, 11 Aug 2022 19:35:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qt1-f172.google.com) smtp.remote-ip=209.85.160.172; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-qt1-f172.google.com ([209.85.160.172]:46049) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oMDxr-000LXm-76; Thu, 11 Aug 2022 19:35:32 +0000 Received: by mail-qt1-f172.google.com with SMTP id j17so9524062qtp.12; Thu, 11 Aug 2022 12:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=qdUiLT+S6KW/rhDMyJrRuImSbKHGAm4gEX2189ux6/g=; b=D86+JiSs4wcfTRDHBw/2LTfVRBW6aF0cH6esCnoL82Hg6sXETF6u16IcDNfgqLdRBJ aTI6LbbkNGGDEPHy5KxGwbbfx44gOutwac7kSL0dbmiP+QlMDYhRdGRI4mKtTlWKWp/r LYLcx+HhyX1ciZRYRe51n1IhOHnvWAvk+uiWbe242bHH9za6UVMFIzdVFDWYW04Z7YdR NDdXMCL5n61vSAfGlmqB1+SsKYtB+8OE7hs/PVk4WKpINmZkoCHcL4ztttY/1/sZ0R5y sWZfr0I04MplKlCeKiwfld4UGipiHcWUjVnIMaewSQlPzgm+8Kl6ZgyRbLQ0SDRKnys7 ObIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=qdUiLT+S6KW/rhDMyJrRuImSbKHGAm4gEX2189ux6/g=; b=Oxq9basw9WcmesTyolCga3ZafMh4nDZs/V4aEMWzUaW1e3PZ2locukDc5SxfHoQlkL vSNMtQpXl8AODULtEMmjad9kRpp5VJK3emxBFssyPZ5yDVzB1BFLHKKekgsBMUhi00IN eOyfqqWq6eyHL5azmh4qCaHQ0io3kybsoFfVWuKhiPmJsl5uDvbJaT8vVcWgpT530Bb4 EPmGSmh8x3zeNHY+CuJoZHxOXJ1/rS0J+Xx+bQ/Y9NkxJsLSuIm5CVbbn3SonDBQubpD FcZDyyegFyyLEd2jHj7BBKTXgLT4pANn8ISkShaCxKAqh7ewk2cx/z8fz93bMYvIS2cY 0zCg== X-Gm-Message-State: ACgBeo3HR8S8g7/3I6yA/g7fSBgfVLJm+I8ZRpKs8+BOD3BGzBse+3WH THhvHZg9GJ14WyrxE3n8xG4bNkcBfy2Gt1kyuxg= X-Google-Smtp-Source: AA6agR7kXsCXdIJI9YT7O0iJVxDUTx5nbH2dd0YWU/iZSKaho3udRi8rHR7eFaj0a8TUV3dg5QHtlU6PIs5RBOq/aYk= X-Received: by 2002:a05:622a:5d3:b0:342:fd8f:5a44 with SMTP id d19-20020a05622a05d300b00342fd8f5a44mr673995qtb.84.1660246530003; Thu, 11 Aug 2022 12:35:30 -0700 (PDT) MIME-Version: 1.0 References: <20220810115120.182853-1-felipe.contreras@gmail.com> In-Reply-To: From: Roman Perepelitsa Date: Thu, 11 Aug 2022 21:35:18 +0200 Message-ID: Subject: Re: [PATCH] prompt: support generic non-visible regions To: Felipe Contreras Cc: zsh-workers@zsh.org, Oliver Kiddle , dana Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 50465 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: On Thu, Aug 11, 2022 at 9:24 PM Felipe Contreras wrote: > > On Thu, Aug 11, 2022 at 12:24 PM Roman Perepelitsa > wrote: > > > > On Thu, Aug 11, 2022 at 4:37 PM Roman Perepelitsa > > wrote: > > > > > > I like this patch [...] > > > > I should've said that I like the idea behind it. The patch implements > > one part of it. To complete the implementation percent expansion needs > > to output \001 and \002. > > That's easy. The current code in prompt.c uses Inpar and Outpar, which > are 0x88 and 0x8A respectively. If instead we do: > > #define invis_start ((char) 0x01) > #define invis_end ((char) 0x02) > > And replace Inpar/Outpar with invis_start/invis_end the code should > behave identically (since those characters are removed). > > Then in promptexpand() we simply not remove them. Let me clarify. Ideally we want (I think) for these two tests to pass: 1. [[ $(print -r -- ${(%):-'%{hello%}'}) =3D=3D hello ]] 2. [[ $(print -r -- ${(m)#${(%):-'%F{1}=E2=9D=8E%f'}}) =3D=3D 2 ]] The first test currently passes, the second fails. In my previous comment I tried to say that making the second test pass will cause the first test to fail. Do you see how to make both of these tests pass? Roman.