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 22899 invoked from network); 11 Aug 2022 17:30:19 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Aug 2022 17:30:19 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1660239019; b=Ra05q09l5znAO0LeM7c4AW8ovr3csX2NKkb5+Ex6gqpMEQaF/bILVp68oO3t0HIV7qkDCkqvwY iwT51A850vt+Arues6aqVqliNzGSWPdp6eRmRBPggE3xoV7xRhAHFk0wK4s/tp7Wa/CqBcrgRE pNG0fW4p3KHfj+A9Jv3fwmzA4035uWwbW11gX51I18IsPC8Nws4jKhWMFC4Qs/pVsUopv0yfyD w405TqFr0GCduyCzzDSVe0s7iod+ogBs31m4IA8obZu0uVwSfypZyWljQJoZkekQIoypGu5nVA tLY8n+9egVtbY604KZdeP2VogurUe/jniNcz1vcyUOnPwA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qt1-f176.google.com) smtp.remote-ip=209.85.160.176; 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=1660239019; bh=uMQ8msxD8GEQOvYXwN+R8Fl5uTyYkXjcxt3NYS6fo2M=; 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:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=FoEV9V1y8/Le5sofybRWID4O8XjUUjVYjC4lOaJ7HGhzncHqrVnjut+DAovvq+WgwhKhUZaiMC NU5DuLa5m7BP96wSUlL8b/alzTRmotSr2bgQJOJJGz6Zsnclo23b6BCFY7CYkWJHjsDZ9Xoa4C B1SvvOowUZyf1JA3gkzU9AUvokcI/fsMnD17tfP5w3vpRG0VryFJ1Wf145+2RZsBmfziv6fver X5qRClzATmyPNilxwFxFvkFYg5X5kwfdyx5dcLmLtYpbGSf82OCQc9b7PCTxCzXGiElDduQmJJ uMh681FmG1wSmUDC/wh+jqqEgWjKOFCUy5LCkAuq6JFYNA==; 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:In-Reply-To:References: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=/xy0sAqqlHhsRP6JmjFRDxOeSwdvzh0Mwg3JLkQ1Sf4=; b=NasC5LADco9CPzI8Ssv8ucIzFT 2H+6wAaFfRp8zZKI6p4JnPKNWn6+aHFlH6rcZfAaYtA4KVm3PGpinzyyw/4FrjBwzhyqrzpeFSKKU sXeA85Ca3F7tWqfiGFISrfC9uzgmCucDYwz9vqKWa3XSZTJbKMsHT/z1B4Pj0Ab3gr0CfP1CPcozR BFyvF9pEXndZSH3nvQeRq4yBlb1nkimp8gZ/N+6ScFnVGXVzF6/ntlYBgfpEUYMY+zYfTg3dyMLFk 3Gfm5ktpChzjZt6fo2rlH7sc9EHoANpbC1sHjKaSGnaXbjiyLCHAdrcgbhzNGyVPMiyIOXO/xb5m6 HGeE5DCw==; Received: from authenticated user by zero.zsh.org with local id 1oMC0g-000Epu-RT; Thu, 11 Aug 2022 17:30:18 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qt1-f176.google.com) smtp.remote-ip=209.85.160.176; 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-f176.google.com ([209.85.160.176]:42528) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oMBvY-000ENr-9i; Thu, 11 Aug 2022 17:25:01 +0000 Received: by mail-qt1-f176.google.com with SMTP id x5so6351054qtv.9; Thu, 11 Aug 2022 10:25:00 -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:in-reply-to:references :mime-version:from:to:cc; bh=/xy0sAqqlHhsRP6JmjFRDxOeSwdvzh0Mwg3JLkQ1Sf4=; b=Wmr7NpSNeJ3yNDzG11UpTxfGPHdounGo81moWGtUJsKS7ZS5CAO1uhJBju6PJgCy4r MqeUzpSeop8UFS0VIMirtk02VxjEE9RrrAqNHLsqgNPcjhbvb633D0D8PheKEis8kcTP zro395V7L5OXmEUfRRXgI2djYelKDjNgl66lYyYy0zEv1FpmY8yt/Kt+hT9m+C0hPl/g XsfErsugoMHy5H2L3nWAK7x5ppbBE2CfW8pFgYJaiNGGwNURx7lyGJT4X/HEYDSAbSox lTSPom0OOn8ut/D8tNjhn0Jn8N+UwVNgozKKQX7UAy7MVhTSPyvROXUtp2N2HPs42PJf D36g== 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:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=/xy0sAqqlHhsRP6JmjFRDxOeSwdvzh0Mwg3JLkQ1Sf4=; b=P45aHWVWyKfdSusGXlkShWry3vZU2j6ppRw2TPuVE7LhpH2j3I+eOCIn/ds5ZFdT5D MQ5TtBV6VrlES08P5eEUl4WiddNmFbwkkKNCjOCQfzeoR2L8ydiMbqeZqXcjiH9G++9G kTX2VV84Lg29NWmPJa9TE4XAJsC2yn+ZtfkAfhJ86C3t77BcLtGtGp4LEvl/8mjszBgf 7yFSbplQwf5AoH3aoT/8dU689A9ulAy6tYxQzAwo/ct3FUjxZFbKFz23dvPYkHAhLtGn aMKstJIL3FPw95/dx/iuSHgTlhml+Y+zFiF3+zO/1IsHsPFCKZS/SgmVSPP5/6B5KLA9 k0fw== X-Gm-Message-State: ACgBeo252apLQ3RwCmeKN6B6LJ2nl4okRsmuF9YTHuOta8Uw0F5bi5Ai Zr8v7IjRzYKcBEXQY99sNiVSSaKy60E9Vphc5Xp0dC9ZQ5s59g== X-Google-Smtp-Source: AA6agR6UiLBg3u5SK3eM6b2ZvwV/KNk5dzoTDVR8tnvgTKgL6ZaTgKHeBLDmHjCPfuIEk+UPqyWcqhPmMc46N/sSJv4= X-Received: by 2002:ac8:5f4e:0:b0:33e:875d:45a8 with SMTP id y14-20020ac85f4e000000b0033e875d45a8mr122174qta.489.1660238698901; Thu, 11 Aug 2022 10:24:58 -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 19:24:47 +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" X-Seq: 50458 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 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. > No real-world use cases come to mind [...] Here's one. If this is implemented, it'll be possible to compute the width of prompt in columns with ${(m)#${(%%)PS1}} (perform prompt expansion and then ask for width). This is necessary in prompts that look like this: left------------------------right bottom% The first line spans the whole width of the terminal. One example of such prompt is `prompt bart` from `promptinit`. This particular prompt can compute the width of `left` and `righ` by utilizing the knowledge of their content. If these pieces could be specified by the end-user, the problem would be more difficult. I've described one (rather cumbersome) solution here: https://www.reddit.com/r/zsh/comments/cgbm24/multiline_prompt_the_missing_ingredient/. Roman.