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

Re: Bug or Feature? Clear line before prompt.



    Hi Ronald :)

 * Com MN PG P E B Consultant 3 <mn-pg-p-e-b-consultant-3.com@xxxxxxxxxxx> dixit:
> I don't see the last line of the previous command, unless it is
> terminated
> by a newline. Example:
> 
>    perl -e 'print "hello"'
> 
> does not show the output "hello", because it is erased immediately by
> the shell, but
> 
>    perl -e 'print "hello\n"
> 
> shows, because the output is terminated by \n.
> 
> My setting of PS1 is:  %B%~%b>
> 
> Is there a way to tell zsh not to erase the line before writing the
> prompt?

    You can always "unsetopt prompt_cr", but I find this one much
more useful:

    # After you've set your PS1
    PS1=$'\n'"$PS1"

    This prints a newline before the prompt itself. You can achieve
this with precmd, too, you can make it print a newline if there is
text on the current line (I think you can know that in Linux using
/dev/vcs), or if the cursor is in the last column, etc. For me adding
a newline character just before my PS1 is enough.

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...



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