From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2133 invoked by alias); 16 Jan 2018 17:04:58 -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: 42289 Received: (qmail 558 invoked by uid 1010); 16 Jan 2018 17:04:58 -0000 X-Qmail-Scanner-Diagnostics: from mail-io0-f173.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.223.173):SA:0(-1.9/5.0):. Processed in 2.325701 secs); 16 Jan 2018 17:04:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: warepire.ml@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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; bh=Jo+fpx9bCWmPviABY/Mv0TYDg+9JED9b4QK23lJlBP4=; b=nFyhUXtqVWWmvbvvoNMooristxCBwW9oEWlgi872K4TZaCf8pS138BOK3l1TqwUs+V I7Qyam37BG9NZCpEqyWlbH1k2KeaxsiVEx9z9KOkLrDevIomLWXzmjO8MHOQr37vt8dC knePWi2MZQkJt62nRp3T9aBGBf7jZvg+L0kc71ugTD3AOkwuDokjDoa6U9afYQp5aoQi FlMPbkIPLohffVjb/zmfNsS/BGGaQx2ZBJ6wsoruvw1stL7DXQkQHmzKjbxIp6PKcRLz gy1EnURdDZx44IVyY1bwZ+S0Hxy1/6PaqPzQ1jRy+LoQIT+gAuWARZ145/2h0KnNhD28 7HrA== 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; bh=Jo+fpx9bCWmPviABY/Mv0TYDg+9JED9b4QK23lJlBP4=; b=jldSqiTftKqCI/6aZoGoqo2j7lDmGlAtT7Z4pYQj7COCNHVCFICXqP0NhAULn75INJ lN5ORjjk+liVmL/hpfblskGoTKoLmNTbDYhjJuPZBgI+G1L1VcPKBo0ifjm8zecUWxVj e6QIstFan1bC/XYri2skYgEyBD3/JvfRtd/UclnhoVffAMNAM0YZJhiFilRRfxNwMDRA PE+Ko9ixBip0TRqcfxlVaopYUPMIfYI67221urqbWN2b83kST//rT6OkWEDnYZ6fpibx L6ZBmIftyGVgk9rsLfp2RPNxXIV4wH6lvc5wimwbL4YqDtxejJsMB6xzmWOS8s841ZK4 bASg== X-Gm-Message-State: AKwxyteuAEsoTj3Z+NB1FyQzgzIQFSDZfDCqHcbubzHfgPLiGU+/Ep/i 85mgO1HuyGpKZzs41yZlvEEp/z6LoY/NU+BIvA== X-Google-Smtp-Source: ACJfBouv9K2R7IG7O2MyWK1AIFiIe2KFqPjpFbr81ZmTS0iCm7SR6bpabyxoec7zTxsuKqO03oemGvBbD2JGFrcsxiE= X-Received: by 10.107.134.97 with SMTP id i94mr13139694iod.210.1516122292976; Tue, 16 Jan 2018 09:04:52 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20180115103558.1258-1-warepire.ml@gmail.com> <20180115103558.1258-2-warepire.ml@gmail.com> From: Warepire - Date: Tue, 16 Jan 2018 18:04:52 +0100 Message-ID: Subject: Re: [PATCH 1/1] prompt: Fix an off-by-one in the overf check in countpromt. To: Bart Schaefer Cc: "zsh-workers@zsh.org" Content-Type: multipart/alternative; boundary="001a113ed0d2b583340562e7ba8a" --001a113ed0d2b583340562e7ba8a Content-Type: text/plain; charset="UTF-8" This is what I was worried about, hence why I included the cover letter. I just tried setting ZLE_RPROMPT_INDENT=0 in my .zshrc and my terminal freaked out, it had no idea what to do with the cursor after I reached the bottom corner. Length or wraps of my LPROMPT didn't matter much since I have a multi-line config. The LPROMPT will not touch that character position, but the RPROMPT does. However, this would most likely indeed freak out on single-line LPROMPTS, although I could not come up with a config that'd do it. I don't think doing this based on ZLE_RPROMT_INDENT is the way to go, libvte based terminals require the number of TCUPs to match the number of lines the final prompt will have when drawn. I am open for fixing this patch, if we can reach an agreement on what the proper handling should be. I am sadly not clever enough about shells to come up with something on my own here. I am available in the IRC channel for discussion if that would help the decision making, since I can test configs quite quickly that way. On Tue, Jan 16, 2018 at 4:28 PM, Bart Schaefer wrote: > On Mon, Jan 15, 2018 at 2:35 AM, wrote: > > From: Warepire > > > > This triggers overf when the prompt is exactly as wide as the > > term, causes countprompt to count a 2-line prompt as 3 lines. > > Which transmits an errorneus TCUP to the PTY. In some terminals > > this causes the last line of the previous command to be erased. > > I see this has already been pushed to the zsh git, but I'm not sure > it's entirely correct. > > This may cause problems on some terminals where auto-margin causes an > additional linefeed when the rightmost (or in some cases only the > bottom rightmost) character position is written. I would be willing > to bet that the original code was intended to account for this, and > other code has changed around it. > > The correct thing may be to make this conditional upon > ZLE_RPROMPT_INDENT, or introduce a similar setting to override the > terminfo assertions of auto-wrap/auto-margin so that the user can > assert whether the additional TCUP is needed. > --001a113ed0d2b583340562e7ba8a--