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 31140 invoked from network); 11 Aug 2022 18:38:22 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Aug 2022 18:38:22 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1660243102; b=sajQZr+ZLFkjda2F1npWt8FyZVa3r17KlI+Si4qRMv/nwSYL/sE2gb+ttj2F87a4bx0s17yc93 5uHULrVsoVGflryHoOtVTgiFXo20g0GuRkRHNXJCwSM1uEQ3S4gZJ86Q6sD4FgR8mh2t/GZMvs XYOZoqUUfTQBx8fwoQeVDwRw4HJsEcrI5r1DEE+X8qkot74yH2VTdU6v7wlOBmtEr+PzGs2Y1u 5wOyEROXB2ol0eOraMHjJP96Hbl2MmFdfTzTl3ksNmu9uc4eBq8OKYstZbWfRGCFc9D5A0ZffF uFk4QcUCEgYyoK6gf+urwJ8Wm37p30IXcLZ0RVTq7RMatQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f174.google.com) smtp.remote-ip=209.85.167.174; 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=1660243102; bh=mkCrA3Nyh/5G1skq14y4hdSJY22VhNogL9b/qnmjw+Y=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:References: In-Reply-To:MIME-Version:DKIM-Signature:DKIM-Signature; b=pRSR0dw8yK0ehQdBDxID5xPDjFXwemVyXFJry8svArzZdXj+Bkv9AF39OnIT4fS2hgfcH59XKd oYM+s73Sz45Qhxqx/0uON/T3A0JIWJzeufCxOfOs6NA/0OvUqO2w1muJkVQGBNmKMWoialnEA4 1YurxFuTG4Q5NuH87+Ch4Ju6HRlkZ1Sz/Ah+3tks+obDsLjJINOPTvGzszoApDqUgQR3XcJd0K OephnXTkstmo+NNctDzIhhOh649SxuWKldE9dQEEPBMJWBim+qn0p2BVd4H9wGsjCRY/PBncv6 DHeEVI0WV+6J22+01hLs9Zo8fEKQ2W1jizu3CuRuFvRIQw==; 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-Type:Cc:To:Subject:Message-ID :Date:From:References:In-Reply-To:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=oDTmn+6kqalXFFSm6cI09e9uqK5zUxykGs3sMd6hUA4=; b=jV7yUp1WMMTEjvkviOsCDmW6Zw OnLDydcHaE9aqOsYiQ4uKaZovF4cjfLRfLbAf2F/JutARzpHM5EV9mF6uGdLpljzswdK8eFVqZgBt d671MlZB85F56XWvtbfsktTzrDQMa4WkptvM9YNi7PFgGKvm3Y0pD9vN0y4mHDwR2XSA8zhzMJJUo p9MVF06ufHqeHBVzB46lXeDwvJuROZ+1prfDkuyUUi1Czn9xHMqlyzgPBusnFjlLpXGhRQEx5MFZJ RJGzX03KDbuBjk1dFfIRwH3wQIR7S4lwwmmsV2PCjWzHdrEsXAf9w0BYTvJ02kwC1mtaXC+jXinxI zTH+9tvQ==; Received: from authenticated user by zero.zsh.org with local id 1oMD4Y-000Gtb-1R; Thu, 11 Aug 2022 18:38:22 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f174.google.com) smtp.remote-ip=209.85.167.174; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-oi1-f174.google.com ([209.85.167.174]:46799) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oMCzL-000GQl-Ay; Thu, 11 Aug 2022 18:32:59 +0000 Received: by mail-oi1-f174.google.com with SMTP id o184so12484644oif.13 for ; Thu, 11 Aug 2022 11:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc; bh=oDTmn+6kqalXFFSm6cI09e9uqK5zUxykGs3sMd6hUA4=; b=Aqm64n526DczMwZktuBnNOLR1t+MEkOvB5SVh7oqny3Zn/JRoQpitcJqUYnKsOGuYv oajVjEZL0siO9kEZY5b2uwxjxLrAliSx3IMoJQk0E8lguooQZHLI75/7T7JEUv5QhIJU 4yZ8ZenpucQ3LgDDmwv/uIq/PD8xQyYH5RR1Ae8VHlM+2lUUz5EwGjLMojgdl33q3aP7 CnUGozqYNYgjK/mjOpELPv/Yoo0MfxMwgfSnsAx7qx6sPweFJPCaJ9PMbCBUuwOcBkT8 ggr8bbaBL6yaeD6dtmnXT5f3ZBNQM0XFsav5RUFYrTdIUijFY0IxiSZP2cTccO9QulCN /b5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc; bh=oDTmn+6kqalXFFSm6cI09e9uqK5zUxykGs3sMd6hUA4=; b=epkoGu3mPlx+2BS477ywB7I6WHdivMazJhM/gouRuOEvSt1/9xycUvHAjAfh8eCPfO xbf54FXv9QYUFwDiXNzWsxYu04rI5b5Z8ZYCZ9TiQdkAQQUzR1XXieeY9msNTDxeWo7B SQZf0iJC4CHKTNsgX16OIJx/q4rD+hxaUjruP1ql6L4ylzLhQipayU2JIx0TksEFocVY xRVDChaCsfrTGhhsnNlbvr8bNj0M66m/W382pBT9+ruoTk6z/cG94DZypD2CSbf46WxK Y2amjks6Aqcung7j9Yw4MYLeF2tXyF+MDZlw7bhyY1g2zp6KUZWe4Z4sZHwGIWx5azlX xIFw== X-Gm-Message-State: ACgBeo0QVA3BPF+7KNogBc0Omq0s30GdGSYa2aPtyQtHtiO+e4Bc6rCv gIFY4CEPGs/hX2SDHrcSVzu2T4yL4CHMpLmYKns= X-Google-Smtp-Source: AA6agR5kIhUPUdLT86Eg25JnjrEiMQ0wETT3QNWkXHzOSHj2w5qTS60OelqEP+OMQt+E1zE4IjT39+Y6XUooaSnZ/f8= X-Received: by 2002:a05:6808:309b:b0:342:f6b0:1b53 with SMTP id bl27-20020a056808309b00b00342f6b01b53mr3937771oib.293.1660242778013; Thu, 11 Aug 2022 11:32:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:1189:0:0:0:0:0 with HTTP; Thu, 11 Aug 2022 11:32:57 -0700 (PDT) In-Reply-To: References: <20220810115120.182853-1-felipe.contreras@gmail.com> From: Mikael Magnusson Date: Thu, 11 Aug 2022 20:32:57 +0200 Message-ID: Subject: Re: [PATCH] prompt: support generic non-visible regions To: Felipe Contreras Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 50459 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 8/11/22, Felipe Contreras wrote: > On Thu, Aug 11, 2022 at 9:02 AM Mikael Magnusson wrote: >> On 8/10/22, Felipe Contreras wrote: >> > On Wed, Aug 10, 2022 at 1:59 PM Mikael Magnusson >> > wrote: > >> >> The commit message seems a bit confused, %F has nothing to do with >> >> marking characters as 0-width, rather everything between %{ and %} >> >> will be treated as such. You can use %{%} (or \001 >> >> \002) to set >> >> colors via the specific \e [ Ps m code, but also to send any other >> >> codes handled by the terminal. >> > >> > If I do PS1='%F{red}foo' putpromptchar() will call >> > set_colour_attribute(), which eventually calls this: >> > >> > if (!bv->dontcount) { >> > addbufspc(1); >> > *bv->bp++ = Inpar; >> > } >> > tputs(tgoto(tcstr[tc], colour, colour), 1, putstr); >> > if (!bv->dontcount) { >> > addbufspc(1); >> > *bv->bp++ = Outpar; >> > } >> > >> > I can do the same thing fputs() is doing with PS1=$'\e[31mfoo', but >> > now zsh will think my prompt is bigger than it actually is and the >> > shell will be screwed. So I have to put that inside %{%}. >> > >> > Therefore "%F{red}" = $'%{\e[31m%}' >> >> Sure, this agrees 100% with what I was saying, but the statement in >> the commit still doesn't make sense. You've proven that you can use %{ >> or \001 to do what %F{} does, but the commit message states the >> opposite which is not true. > > The commit message says: > > 1. We do readline $'\001\e[31m\002' as zsh '%F{red}'. > > This is true. The statement is true, but it's not what the commit message says, it says: "readline assumes anything between \001 (start of header) and \002 (start of text) is non-visible characters. In zsh we do this with `%F{color}`" I don't know why you are arguing about this, there's nothing bad about fixing an error in a commit message after someone points it out. > 2. We could support $'\001\e[31m\002'. > > This is also true. That's true. -- Mikael Magnusson