Zsh Mailing List Archive
Messages sorted by:
Re: PATCH: draw prompt on the correct line after window change
- X-seq: zsh-workers 44544
- 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 10:16:52 +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=U3RNLJ2GH3dJHQnJkBTycSAH1R/+XRc9D5Aum2bvMbE=; b=AWPlT5iq2uvfb1qK2+G9wcnlFfzJK7ZZtgIM3rvK55YgM9dhMh4YLjH7FFLSln+77P oaOIa+NbA7ZMCOQpQx2StmR+HUY1KewoC+mK5NhwXSvEOBKzbjajIykZOLE3PnPjBtjL s/GPZstblzshut2uSGsjRHktUGbCVybYZYxAThbhWEyjebTm7KmWdjaEaL9F1JI0nemA B7eattiG9FPjFOS2vd6Z87dluA3hZWZo+pd2LlC2AbqGx9zRSp5BnMuB/aFz1GlbmCpW rK2bnc0K5GcbJQ1SKE5m7C3t5MMlO9m/0A1wrpNBvZ/cardYZ+NmlNzhqxVADRsxi0zW b5oA==
- In-reply-to: <CAH+w=7Z0D-sZeHAZROhmVp7waTy=1bSkR3DvqX2gqectCG6tgA@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> <CAN=4vMr2VTtJ-8TXtMNkf2YN=1nekYneRr6EPTPg_gkc9w6dew@mail.gmail.com> <CAH+w=7Z0D-sZeHAZROhmVp7waTy=1bSkR3DvqX2gqectCG6tgA@mail.gmail.com>
On Tue, Jul 16, 2019 at 1:28 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Install some of the alternate window managers provided with the
> various OSs you have, rather than the default ones. There's a
> plethora of them. The main thing is one that does live redraw while
> resizing windows, rather than having you drag a window outline around
> and then snapping the window to the outline when you release the
Got it. So far all tests I've done were with window managers that
redraw the window continuously while it's being resized. I'll make
sure to test with those that don't redraw until the mouse button is
> > This patch [is] only doing writes to the terminal without any reads.
> > Whenever ZLE prints prompt, it issues TCSAVECURSOR
> OK, then there is a different problem: Nothing prevents the prompt
> itself from printing TCSAVECURSOR/TCRESTRCURSOR, and in fact some of
> the themed prompts provided with zsh do that. There's no way for zsh
> to guarantee that the cursorsaved flag is accurate.
In my patch I attempted to not break code that stores/restores cursor.
It'll work in all the following cases:
1. The cursor is saved and restored by a foreground process.
2. The cursor is saved and restored in precmd.
3. The cursor is saved and restored in preexec.
4. The cursor is saved and restored by PROMPT and/or RPROMPT.
Cursor cannot be restored if the terminal window may have been
scrolled due to extra lines added at the bottom. This limits the
number of places where anyone can save/restore cursors. For example,
saving the cursor in precmd and restoring it in preexec won't work
because there can be new lines added in between (unless
single_line_zle is set, but in this case my patch doesn't save/restore
cursor). I _think_ my code doesn't break working code but I may be
wrong. What should I test with? Which theme(s) save and restore
It's worth reiterating that currently prompt refresh on window change
is quite broken. Even if my patch isn't perfect, it still may be an
improvement (it is so far in all my tests).
Messages sorted by: