zsh-workers
 help / color / mirror / code / Atom feed
* promptcr workaround
@ 2005-03-01  8:17 Karl Chen
  2005-03-01 16:41 ` Wayne Davison
  2005-03-01 17:39 ` Bart Schaefer
  0 siblings, 2 replies; 8+ messages in thread
From: Karl Chen @ 2005-03-01  8:17 UTC (permalink / raw)
  To: zsh-workers


I've always been unsatisfied with the answer to FAQ entry
3.23 "How do I prevent the prompt overwriting output when there is
no newline?"  I dislike zsh's promptcr behavior both on and off.
I don't like silently losing the last line nor having a messed-up
prompt, and didn't like adding an extra newline on every command.

Here's a way to simulate adding the \n only when necessary:

    function precmd {
        echo -n ${(l:$COLUMNS:::)}
    }

This prints $COLUMNS spaces.  Iff there's any output on the line
already, it'll wrap to somewhere on the next line.  So when zsh
prints the \r it'll always erase only spaces.


-- 
Karl 2005-03-01 00:10


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-03-02 20:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01  8:17 promptcr workaround Karl Chen
2005-03-01 16:41 ` Wayne Davison
2005-03-01 17:06   ` Wayne Davison
2005-03-01 19:50   ` Karl Chen
2005-03-01 17:39 ` Bart Schaefer
2005-03-01 18:20   ` Danek Duvall
2005-03-01 18:50     ` Wayne Davison
2005-03-02 20:21   ` Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).