From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2567 invoked by alias); 16 Jan 2018 15:28:48 -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: 42288 Received: (qmail 6015 invoked by uid 1010); 16 Jan 2018 15:28:48 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f41.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.215.41):SA:0(-1.9/5.0):. Processed in 3.351367 secs); 16 Jan 2018 15:28:48 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lh8ufQUU9seSw+ZkEx4fXif1b86ZUEhKbGNE/oukFxk=; b=fSqI9i3PK7oFGTP/q3WyHuMYeSg4pCvJDgQxMpfuZajEr9Fpu0lr7X+3/sUUASW1W/ 1mFcDB8MLj2K9XDmUEqdyNOHC33Gy1WpfssVXLUCv4mzAMttWEl9dweAISVOrI68arUH ojHrkw+V289SuT8WEZ0XbPS47Km9KXt4wcM8JfKrCLX1baYHCS8mmF+NCLn7dlgW+jjt W3C88Pc10BFLFqY65G309AJWsXOw+je1mESaqMDdZz2/6R6tmFXjaJplyf+9Jpv0ld9q FRsZPQhIvzQw+NoaCC6nLD9Ad4wyD6LnrdP39nPi40ddK/RbeAp831qQnn+6Zc1rmmh5 6Pnw== 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=lh8ufQUU9seSw+ZkEx4fXif1b86ZUEhKbGNE/oukFxk=; b=UJyz7ywTESbjtzGUdVZ3a7qaSspKjk20NA0sjr/bZUWl2CsSPKMrs2FMALLu+riItr mG/tO+FZdkhUHWpziNn/XIV1383wxjCKVX8x6HkBPb/OhF52z9KunkBYMjxu4ROcQjsw 2I+7Gk+/Q4t2EExChjiUsCahH1XR+ahc1Jztd2A3f5T1xGUUahrvGx0ZZN3yulsbJ6Lw dld6FeXuNZPHoYdNJKkE4yitI84kFK5x37O9vHcRd8K+933KpH11jYA5wKz9/yQVWH+u uFZTCetvY109Ml9F9BS9qQdB2lzVtwEMSwwGwWN5R21IDCJtdy/7RfiBTD9PenhzeX+X 6TgA== X-Gm-Message-State: AKwxytdlaWDc+V4WV/gRe0EehomPN3LbbcfxivxS0z9KXYfWr5ecxafa mVusxRAjGMj6HiXsGveFn0YG+2BkYW9lG6tBIKA9Dw== X-Google-Smtp-Source: ACJfBouL4GsRV1ZKtxTxIx2sg/eebR40HNeHi02+u1qSJy3BuQIEebj2AHYK2Lz+izH6tAB7mnjxEeQR2GFhC+tTj7w= X-Received: by 10.25.181.155 with SMTP id g27mr14326551lfk.47.1516116519416; Tue, 16 Jan 2018 07:28:39 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20180115103558.1258-2-warepire.ml@gmail.com> References: <20180115103558.1258-1-warepire.ml@gmail.com> <20180115103558.1258-2-warepire.ml@gmail.com> From: Bart Schaefer Date: Tue, 16 Jan 2018 07:28:38 -0800 Message-ID: Subject: Re: [PATCH 1/1] prompt: Fix an off-by-one in the overf check in countpromt. To: "zsh-workers@zsh.org" Cc: warepire.ml@gmail.com Content-Type: text/plain; charset="UTF-8" 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.