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

Re: prompts with newlines get printed twice



On Sep 24,  4:24pm, Jorge Israel Pena wrote:
}
} So are there any known workarounds? Or is this something that would
} have to be fixed in zsh itself?

Until a few minutes ago I'd have said it was something that needed to
be fixed in Terminal, but I may have found a zsh bug that's behind it
all.  I've sent a possible fix to zsh-workers for discussion.

On Sep 24,  5:14pm, Jorge Israel Pena wrote:
} 
} Hey guys. I have extracted what I felt were the relevant parts from my
} previously posted link. Like I said, I am no zsh expert (In fact I'm
} completely new to it) so I don't know if this is right or if there are
} more efficient, better ways of doing this.
} 
} Source: https://gist.github.com/1240023
} 
} I tested it various times and it seems to be working perfectly.

I don't find any evidence that this helps except possibly by waiting to 
change the prompt until the first time the WINCH is received, which
would avoid the startup-time double prompt.  I still get the prompt
printed multiple times if I later resize the window.

However,

    trap 'tput cuu1' WINCH

(that is, move up one line on each WINCH signal) might work around it
for you.  If your prompt has more than two lines, you'll need to move
up one less than the number of lines in the prompt.



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