Zsh Mailing List Archive
Messages sorted by:
Re: PATCH: several bug fixes in countprompt
- X-seq: zsh-workers 44432
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: PATCH: several bug fixes in countprompt
- Date: Wed, 19 Jun 2019 16:44:27 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- 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==
- In-reply-to: <firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- List-unsubscribe: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20190619102623epcas3p27d38284482c5631e0585059dc0b732a6@epcas3p2.samsung.com> <CAN=4vMrT_CrkbCD7wsJnAwHSjLXgqHPusVzBuzD_Q8Oui3LN1g@mail.gmail.com> <firstname.lastname@example.org>
On Wed, Jun 19, 2019 at 12:56 PM Peter Stephenson
> 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.
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
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
Messages sorted by: