Mein Haus, meine Straße, mein Blob

Jan 04, 2013

Multi-line ZSH prompts

Not that I'd be using something like this, but since the question came up in #zsh and I couldn't find any post listing the most sensible solutions, I decided to document the results.

In order to get a prompt that looks like

host – 13:33:37

just set your PROMPT variable to one of the following values.

Option 1: Use \n within $'' (that's two single quotes):

PROMPT=$'%m – %*\n%n:%~:%# '

Option 2: Use a line break within "":

PROMPT="%m – %*
%n:%~:%# "

Option 3: Use $prompt_newline

PROMPT="%m – %*$prompt_newline%n:%~:%# "
posted at 16:52  ·   ·  linux  zsh  prompt