Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "off by one fix in multiple prompts" breaks multiline prompt



On Mon, 13 Aug 2018 13:42:50 +0200
Guillaume Chazarain <guichaz@xxxxxxxxx> wrote:
> On Mon, Aug 13, 2018 at 1:36 PM Peter Stephenson
> <p.stephenson@xxxxxxxxxxx> wrote:
> 
> > So you're saying the commit you say is causing the problem isn't
> > fixing the problem it was supposed to fix?  That implies something
> > else changed, since dana tried it out at the time and said it
> > worked. 
> 
> Sorry, I was unclear.
> The commit is indeed fixing the problem it was supposed to fix.
> I meant that on all terminals I tested, I saw consistent behaviour:
> the commit fixes the original problem but introduces a new one (mine).
> So it looks like it should be possible to fix both problems.

Thaks for that.

I suspect dana was saying we need something like this?  Has this got
anything to do with it?  (Second guessing other people's fixes is really
hard work...)

pws

diff --git a/Src/prompt.c b/Src/prompt.c
index 959ed8e..758d5f2 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -1170,7 +1170,7 @@ countprompt(char *str, int *wp, int *hp, int overf)
      * This isn't easy to handle generally; just assume there's no
      * output.
      */
-    if(w >= zterm_columns && overf >= 0) {
+    if(w > zterm_columns && overf >= 0) {
 	if (!overf || w > zterm_columns) {
 	    w = 0;
 	    h++;



Messages sorted by: Reverse Date, Date, Thread, Author