You are not logged in.

#1 2014-04-23 14:36:34

Mathuin
Member
Registered: 2014-04-11
Posts: 16

Multiline zsh prompt messes RPROMPT

Hello,

I have a multiline zsh prompt which is fine, but I'd like to add the hour in the RPROMPT. Unfortunately, the RPROMPT displays at the end of the second line of the prompt, whereas I want it at the first line. What I have looks like this:

~
>>= archey                                         3:22

And I would like this:

~                                                           3:22
>>= archey

So, I tried adding a control character to move the cursor up one line, but it still doesn't work. Before adding a control char:

autoload -U colors && colors
setopt prompt_subst
PROMPT=$'%{$fg[blue]%}%~%{$reset_color%}
%{$fg[red]%}>>=%{$reset_color%} '
RPROMPT="%D{%L:%M:%S}"

And after:

autoload -U colors && colors
setopt prompt_subst
PROMPT=$'%{$fg[blue]%}%~%{$reset_color%}
%{$fg[red]%}>>=%{$reset_color%} '
RPROMPT="\033[1A%D{%L:%M:%S}"

Could you help me sort this out ?

Last edited by Mathuin (2014-04-23 14:36:57)

Offline

Board footer

Powered by FluxBB