From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id f465788c for ; Wed, 19 Jun 2019 14:45:23 +0000 (UTC) Received: (qmail 13972 invoked by alias); 19 Jun 2019 14:45:14 -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: 44432 Received: (qmail 17592 invoked by uid 1010); 19 Jun 2019 14:45:14 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25482. spamassassin: 3.4.2. Clear:RC:0(209.85.166.54):SA:0(-2.0/5.0):. Processed in 1.452469 secs); 19 Jun 2019 14:45:14 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.54 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=85l4OC+AkeWbnvOrCI690MTuvdSOPx9UzSe+wFv39VE=; b=HPcS2yEkFuPT8/eK4US/vn32rqkS+RC9jLDPWyde6kPkg1f4UvJUufrmsyAO9NVTM6 hXunjP+ZcI5PsH09aMESqfbN31ZRp0QCMoB0qcv29iOuNDJ9/WkqTIJcXKBBBF98ofRh LjGW1uXlY6In0K7fOUjaAByqmfbGiymwd9jVRfNiFzc4iCRaXsc8/3mNWohUu0qbxpI2 ONB4CKiqo5i8NJCb0d/Tfzz5aBOsqMiz77lw03ITuUNZ4cqX0ebqJanXZhsVoYaatJhn +QpLt6M75oH9ucG4eYV7d7fYSdO6VGeZhiRJ2CIpx2LVXOgkdQGUPYfMjftgakG3qXSp zRtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=85l4OC+AkeWbnvOrCI690MTuvdSOPx9UzSe+wFv39VE=; b=jNfYIZCUOZZ2Q4p/IWDemKFptzMf8OIJ67xk5DHldnFD/RLXZQsO9CwNOchO9MqX8L KxuXCZgUbSJTsJIZkn5p0OE/xB2sSFM2vhJTJmf4y/SMi9e+Q0N6/jyWJxD73bkk1qUF d3kXOc3T9AQxUi7IaaU4RYfn9dh6A1067J3TWACFm75FuCLCEIaiLfVkFqGHQqgLdhY/ Kn7V9ES+nE2JKuCLMoBelRNPxFKw/yKBnhjlaJ53vYdsqJBgWBFQRZsVzhuYKeRKa5h8 YTyS2Jt5gPgsXhs6zG7H3TL46EyAqHSJ87vYY9MJIU3SWhEcq3BOKWhr9Vt1gla8gWqJ RABQ== X-Gm-Message-State: APjAAAUBCtc0aoj7vm9NMIrOaYUv+XPTIiyLRto4bZxpntInVlIMgvLb kRmp7gvPBhKu4OZI1Lla2hFa1LoyXFqmI0YXEMaIgs/t X-Google-Smtp-Source: APXvYqw6rGSo5WzElOq2RA2hiztGjD1w/G0JC4eizODPHwVegFbJZw5RoC4/k42XAvhzQ0Wa1z8FN22yztjWtCqAxFQ= X-Received: by 2002:a6b:7208:: with SMTP id n8mr1139821ioc.151.1560955478723; Wed, 19 Jun 2019 07:44:38 -0700 (PDT) MIME-Version: 1.0 References: <1560941762.23478.2.camel@samsung.com> In-Reply-To: <1560941762.23478.2.camel@samsung.com> From: Roman Perepelitsa Date: Wed, 19 Jun 2019 16:44:27 +0200 Message-ID: Subject: Re: PATCH: several bug fixes in countprompt To: Peter Stephenson Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Wed, Jun 19, 2019 at 12:56 PM Peter Stephenson wrote: > > On Wed, 2019-06-19 at 12:22 +0200, Roman Perepelitsa wrote: > > This patch fixes multiple bugs in countprompt. > >... > > I've only tested it on one terminal. Before I test it on a dozen of > > different terminals, is there anything I'm missing? Anything I should > > be on lookout for? > > Thanks. I think the experience has usually been wide characters either > work on a terminal or don't work, but I don't think anybody's specifcally > looked for edge cases before. Other characters and effects are usually > fairly predictable. Got it. I've tested the patch on several terminals. Here's what I've found. 1. All terminals suffer from bug #1 and the patch fixes it everywhere. 2. All terminals that support wide characters suffer from bug #2 and the patch fixes it. Terminals that don't support wide characters have incorrect cursor position both with and without my patch. 3. All terminals suffer from bug #3. However, my patch fixes it only for some terminals but not for all. There are two ways terminals handle tabs that don't fit on the line. The first is what I've described in the patch: tabs are treated as sequences of spaces, and some spaces can overflow to the next line. Thus, with COLUMNS=77 and PROMPT consisting of 10 tabs, prompt ends up taking two lines with the second line having just 3 spaces on it. The second way is that the cursor remains on the last column of the first line without ever wrapping around to the next line. In addition, cursor behaves rather unexpectedly when you start typing in such prompt. The first typed character appears at the end of the line, the second typed character also appears at the end of the line while pushing the previous character to the left, but the third character overflows to the next line. To summarize, my patch doesn't seem to break anything, fixes bug #1, fixes bug #2 everywhere where it makes sense, and fixes bug #3 where it's feasible. Roman.