Sign up ×
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

Like this (I know, looks awkward):

 %> "
share|improve this answer
secondline "


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

Taken from FAQ, item 3.13

share|improve this answer

Use $'\n'

For example,

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


PROMPT="firstline${NEWLINE}secondline "
share|improve this answer
Worked just like I needed it too. – Justin May 12 at 17:09

Your Answer


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.