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

Re: get the number of active jobs to show in the prompt?



On Oct 3,  6:47pm, Vincent Lefevre wrote:
} Subject: Re: get the number of active jobs to show in the prompt?
}
} > If notify is involved, then the fact that the prompt could change
} > length and that the current "prompt level" could need to change from
} > PS2 or deeper back to PS1, leads to all the objections that have
} > been raised.
} 
} In my case, the length isn't changed. So, this is not my problem.

Yes, but to implement a general solution in the ZLE C code, the possibility
that the prompt might change length would have to be dealt with.  And even
if the PS1 prompt doesn't change length, the insertion (or not) of the
various PS2 and other prompts could change the screen.

} > 	# zle .clear-screen	# You may or may not want this
} 
} I want this, so I uncommented it.
} 
} This doesn't work: the screen is cleared, but then, the prompt is
} printed twice.

Right, the old prompt and editor input is redisplayed by clear-screen,
and then the new prompt is generated and displayed below that.

} Replacing "zle .clear-screen" by "clear" almost works.
} The problem is that push-line seems to send a \n.

Again, that's right.  ZLE doesn't know that you've erased the screen with
"clear", so it thinks it has to move down past the current editing area
before redrawing the new prompt.

There's no way to force it to draw the new prompt directly on top of the
old one, because of the the length-may-have-changed etc. reasons above.
There's also unfortunately no way to get it to regenerate the prompt first
and then do clear-screen afterwards, because `send-break' aborts even a
user-defined widget in progress.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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