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

PATCH: 3.1.6* (Was: Weird behaviour with certain PS1-sequences)



Peter Stephenson <pws@xxxxxxxxxxxxxxxxx> typed:
:Dan Nelson wrote:
:> % zsh -f
:> % PROMPT="%m %n %/ %%"
:> dan dan /home/dan % TERM=dumb
:> dan dan /home/dan % 
:>                     ^ blanks start here and don't stop
:
:Yes, I can see this, and what's going wrong, in the refresh code.
:Unfortunately I'm not sure I understand the logic well enough to fix it,
:though if Geoff doesn't get around to it I will have to try.
:
:The spaces in the prompt match what is on the line already at that point,
:i.e. nothing.  singmoveto() is called to skip over them, one by one.
:(Since we're skipping only one character in this example, it would
:presumably be more efficient just to output it, but that's a different
:question.) 

The problem is that if we're in singlerefresh() mode then we don't use
the normal prompt anyway.  Since we're using a different prompt we can't
do prompt writing in tc_rightcurs().

--- Src/Zle/zle_refresh.c.org	Thu Jul 15 18:27:59 1999
+++ Src/Zle/zle_refresh.c	Sun Oct  3 18:48:00 1999
@@ -945,7 +945,7 @@
 /* otherwise _carefully_ write the contents of the video buffer.
    if we're anywhere in the prompt, goto the left column and write the whole
    prompt out unless ztrlen(lpromptbuf) == lpromptw : we can cheat then */
-    if (vln == 0 && i < lpromptw) {
+    if (vln == 0 && i < lpromptw && !(termflags & TERM_SHORT)) {
 	if (strlen(lpromptbuf) == lpromptw)
 	    fputs(lpromptbuf + i, shout);
 	else if (tccan(TCRIGHT) && (tclen[TCRIGHT] * ct <= ztrlen(lpromptbuf)))


-- 
Geoff Wing : <gcw@xxxxxxxxx>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@xxxxxxxx>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <gcw@xxxxxxx>       Phone   : (Australia) 0413 431 874



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