Zsh Mailing List Archive
Messages sorted by:
Re: PATCH: draw prompt on the correct line after window change
- X-seq: zsh-workers 44540
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: draw prompt on the correct line after window change
- Date: Tue, 16 Jul 2019 00:09:46 +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=bxGzirU9r418X0Yw4I5htUUSzJHftrBKeyoTAAAxqCM=; b=FrpFFRkUSiMMtMhTqRzyd9M8IcEoa+lUQT/TytvCLRo3THyPqnPf0WQFCtulYFA4CO 2vy52qZ6YjjoVyE5Sez1ry2tcVOifq4GO8o1Pt1fTxx5oj66IITvaQTKhbNTDZ1RPYg8 41PW5vkYeHVmdLoami4X0OQ9aSDHPJptu+nJQZqsjwdck/TI1VCxFp2olj2OhOy0L8do SpsNVQh4gJJ0L7sy1/ylqQ2134TuojlyTcknInv+f4CX7aw0AP88X27DD3ENRaZjhHZS UGg2Qfte3SZR8NA1sOe/U+p8SQJnyWV7P18CHzju259zEWoFavmanqctG3LFFkqcaARG De+g==
- In-reply-to: <CAH+w=7aLYK6jGcyg6t_FUKaMdzdQJOt7kCod=Ct8Fmjtd00KiQ@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- List-unsubscribe: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAN=4vMp+E7esA48bEtRs-+Rmm9ng7i+FayGVqcLZqyjwVkayAw@mail.gmail.com> <CAH+w=7aLYK6jGcyg6t_FUKaMdzdQJOt7kCod=Ct8Fmjtd00KiQ@mail.gmail.com>
On Mon, Jul 15, 2019 at 11:24 PM Bart Schaefer
> On Mon, Jul 15, 2019 at 10:21 AM Roman Perepelitsa
> <roman.perepelitsa@xxxxxxxxx> 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,
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.
Messages sorted by: