I know that this could look like something already asked before, but I cannot have those thing work for me, maybe because I use tcsh instead of zsh.

And there is no way for me to change shell, so if this is something "blocking" for what I would like to achieve, that's fine.

Basically what I have, right now is something like this:

set prompt='%B%~%b > '
set rprompt='[%{\033[36m%}%$VAR1%{\033[0m%}|%{\033[37m%}%$VAR2%{\033[0m%}] %P'

What I would like to have is a multiline prompt, with rprompt that is kept on the same line that the first line of prompt has, if that make sense.

If I just try to do something like this:

set prompt='%B%~%b\n > '
set rprompt='[%{\033[36m%}%$VAR1%{\033[0m%}|%{\033[37m%}%$VAR2%{\033[0m%}] %P'

(I've added the \n in front of the > symbol, on the prompt)

What happend is that the rprompt disappear completely.

There is a way to avoid this, or maybe use some kind of padding of some sort?

I've tried the r-padding bit, but looks like my tcsh terminal does not supports it or i'm using it wrong.

NB: If there is some other question with the answer that could help me solve this issue, please feel free to link me to that question.




This is what I would have:

PATH TO CURRENT FOLDER                                    RANDOM INFO + CURENT TIME
[if exist, my git branch] > 

or, even better:

PATH TO CURRENT FOLDER                                    [GIT BRANCH] CURRENT TIME
RANDOM INFO                                                             RANDOM INFO

Hope that this makes clear what I would like to accomplish.

But, basically, I just want to know how to work with a multiline prompt in tcsh.

I am using tcsh version 6.17.0 running in gnome-terminal version 2.31.3.

  • Argh, sorry, my bad. I can reproduce this, the rprompt does indeed disappear when adding a \n to the prompt. I had a mistake when testing before, sorry. – terdon Oct 20 '17 at 16:04
  • No worries, that means that is just the way things works on tcsh ;) – Andrea Rastelli Oct 20 '17 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.