Sunday, December 14, 2014

Customizing the Bash Prompt to Be More Romantic

I used to have a long, detailed Bash prompt like this:

happycode:open-source-repos audreyr$

To get this, I had this line in my .bashrc file:

# Bash prompt displays the hostname, current directory name, username
PS1="\h:\W \u\$"

But I eventually grew tired of seeing all that useful information, as it made my prompt too long. It was time for a change.

I thought about what I wanted to be reminded of every time I opened my terminal. Something happy, I thought. The happiest thing is love.

So I changed it to this:

# More romantic bash prompt.
PS1="\W a♥d "

That's short for Audrey ♥ Daniel, of course.

You can use other Unicode symbols in your Bash prompt to jazz it up, like happy faces and flowers. See this post on the Unix StackExchange about someone with an awesome ★ in their prompt.