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

Re: Wish for rprompt feature



On Mar 19, 12:41pm, Thorsten Kampe wrote:
}
} I have my pwd ("%~") in my RPROMPT (as probably many people). When the
} path to the pwd is long (or I type a long command line) the rprompt
} disappears and makes place for my typing.
} 
} This is a feature and generally a good thing but the problem is that
} the /whole/ rprompt disappears and not just the space I need.

Have you looked at some of the "prompt themes" that come with recent zsh?
A couple of them include two-line prompts that put the working directory
on the upper line, out of the way.

E.g. my prompt (the "bart" theme in the distribution) looks like this
(I've narrowed it to a 70 column terminal in hopes of avoiding line
wrap):

zagzig [cvstat] /usr/src/local/zsh/zsh-4.0           04-03-20  8:47AM
schaefer[603]                                                   4.0.6

Only the zsh version (4.0.6) is in the "real" RPS1, everything else is in
PS1, but the date and time at upper right behave like an rprompt in that
they'll disappear if the previous command (in brackets -- cvstat is an
alias that runs "cvs status" through a sed script) or the directory name
get too long.  The prompt will even go to three lines if it must:

zagzig /usr/src/local/zsh/zsh-4.0                    04-03-20  8:53AM
[echo this is a really long command string for example]
schaefer[605]                                                   4.0.6

And the various bits are all differently colored, too which obviously you
can't see in this email.  By the way, running "prompt bart" just adds the
upper line to your existing PS1 and RPS1 -- it doesn't change the lower-
left part -- so to get the above effect I use

PS1='%n[%h] '
RPS1=$ZSH_VERSION
prompt bart

The other theme that does something similar is "clint".



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