zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: draw prompt on the correct line after window change
Date: Tue, 16 Jul 2019 00:09:46 +0200	[thread overview]
Message-ID: <CAN=4vMr2VTtJ-8TXtMNkf2YN=1nekYneRr6EPTPg_gkc9w6dew@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7aLYK6jGcyg6t_FUKaMdzdQJOt7kCod=Ct8Fmjtd00KiQ@mail.gmail.com>

On Mon, Jul 15, 2019 at 11:24 PM Bart Schaefer
<schaefer@brasslantern.com> wrote:
>
> On Mon, Jul 15, 2019 at 10:21 AM Roman Perepelitsa
> <roman.perepelitsa@gmail.com> wrote:
> >
> > I've tested this code only on GNOME Terminal. Before I go testing on a
> > dozen different terminals I'd like to get some feedback. Anything I'm
> > missing? Anything tricky to look out for?
>
> The most significant problem with window resizing is not the terminal
> itself, but window/session managers that try to do "live update" of
> the window contents as the cursor is rapidly dragged around.  These
> tend to send a stream of WINCH signals which we have had to do various
> tricks to manage.  I would be concerned that attempting to write a
> control sequence to the terminal and read back the response in the
> midst of a flood of such signals would fail as often as it succeeds.
> If this is already limited/controlled by the mechanisms in place,
> great.

This patch isn't only doing writes to the terminal without any reads.
Whenever ZLE prints prompt, it issues TCSAVECURSOR which instruct the
terminal to save the position of the cursor in a special stash. When
window resizes, ZLE issues TCRESTRCURSOR to tell the terminal to move
the cursor to the previously saved position. The nice thing about
these commands is that the stashed cursor position will still be in
the right place after the terminal has reflowed text.

I _think_ this shouldn't window/session managers but I'll definitely
need to test it first. Do you have suggestions on what I should test
with? I have a battery of 13 terminals and 4 operating systems that I
use for testing changes but I'm not sure any of my configurations
qualify as high-risk for this patch.

> > The patch is attached to the email. You can also see it in
> > https://github.com/zsh-users/zsh/compare/master...romkatv:fix-winchanged.
>
> Thanks for the link, it's the only way I was able to see this on a
> mobile device.  Please inline patches, or attach them as text/plain
> (not text/x-something), without base64 encoding if possible.

Sorry about that. I don't think it's possible to specify content type
for attachments in GMail. Perhaps if I attach *.txt instead of *.patch
it'll become "text/plain"? I'll try it next time.

Roman.

  reply	other threads:[~2019-07-15 22:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 17:20 Roman Perepelitsa
2019-07-15 19:14 ` Mikael Magnusson
2019-07-15 19:32   ` Roman Perepelitsa
2019-07-15 19:41     ` Roman Perepelitsa
2019-07-15 21:24 ` Bart Schaefer
2019-07-15 22:09   ` Roman Perepelitsa [this message]
2019-07-15 22:11     ` Roman Perepelitsa
2019-07-15 23:28     ` Bart Schaefer
2019-07-16  8:16       ` Roman Perepelitsa
2019-07-16  0:01     ` Bart Schaefer
2020-01-06 17:50 ` Sebastian Gniazdowski
2020-01-06 18:07   ` Roman Perepelitsa
2020-01-06 18:31     ` Sebastian Gniazdowski
2020-01-06 18:46       ` Roman Perepelitsa
2020-01-06 19:02         ` Sebastian Gniazdowski
2020-01-06 19:28           ` Bart Schaefer
2020-01-06 19:38             ` Roman Perepelitsa
2020-02-01 17:22               ` Roman Perepelitsa
2020-01-06 19:40             ` Sebastian Gniazdowski

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=4vMr2VTtJ-8TXtMNkf2YN=1nekYneRr6EPTPg_gkc9w6dew@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=schaefer@brasslantern.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).