Search code examples
macosterminalzsh

How to configure zshell's terminal to start a new line


I want to change my terminal from:

user@name-Air ~ % <My command>

to something like

user@name-Air ~ %
<My command>

Basically I want my command to start on a new line.


Solution

  • The following code in your ~/.zshrc will begin the input on the next line:

    PS1='%* %D %%
    '
    

    that is, simply placing an explicit newline at the end of the prompt formatter.

    As example implementation using echo:

    ~ %echo "PS1='%* %D %%\n'" >> ~/.zshrc
    ~ %zsh
    20:24:04 23-08-05 %
    ls -lah /etc