zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: several bug fixes in countprompt
Date: Wed, 19 Jun 2019 16:44:27 +0200	[thread overview]
Message-ID: <CAN=4vMp4+C1GjRLUaptCq-59EjQ7AmWC+BF3-b=nkYDuoJ6wEQ@mail.gmail.com> (raw)
In-Reply-To: <1560941762.23478.2.camel@samsung.com>

On Wed, Jun 19, 2019 at 12:56 PM Peter Stephenson
<p.stephenson@samsung.com> 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.

  reply	other threads:[~2019-06-19 14:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190619102623epcas3p27d38284482c5631e0585059dc0b732a6@epcas3p2.samsung.com>
2019-06-19 10:22 ` Roman Perepelitsa
2019-06-19 10:56   ` Peter Stephenson
2019-06-19 14:44     ` Roman Perepelitsa [this message]
2019-06-19 14:52       ` Peter Stephenson
2019-06-19 14:58       ` Bart Schaefer
2019-06-19 15:09         ` Roman Perepelitsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMp4+C1GjRLUaptCq-59EjQ7AmWC+BF3-b=nkYDuoJ6wEQ@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).