Mac OS Lion Terminal: Add blank line after command output?

How can I configure my .bash_profile to add a blank line after any command output?

2 Answers

You want to adjust the shell prompt; the default shell is bash, and it will happily inject a newline into the prompt by embedding \n in the appropriate variables. (PS1 by default.)

More details at or in the manual page - though that is a much more pleasant reference.

2

Add the following line at the end of ~/.bash_profile or ~/.bashrc, whichever exists:

PS1="\n$PS1"

This will add a newline before a prompt is printed, which is after control is returned to the shell.

Unless your command prompt contains shell commands or variables (which would get executed/interpreted at the time of variable assignment), this will work. Otherwise, just prepend the \n to your original prompt definition.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like