Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to setup a multiple line PS1, for zsh, but \n doesn't was parsed by zsh,

PS1="%~\n %> "

How should I set it up?

share|improve this question

3 Answers 3

PS1="firstline
secondline "

or

PS1=$'Hi Joe,\nwhat now?%# '

Taken from FAQ, item 3.13

share|improve this answer

Like this (I know, looks awkward):

PS1="%~
 %> "
share|improve this answer

Use $'\n'

For example,

PROMPT="firstline"$'\n'"secondline "

or

NEWLINE=$'\n'
PROMPT="firstline${NEWLINE}secondline "
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.