If you’re using a modern terminal emulator with unicode support (for example, the default Gnome terminal shipped with Ubuntu) you can add Emoji to your bash prompt.
If you’ve never changed your bash prompt, it probably looks something like this:
username@hostname ~ $
You can customize your prompt within your
Feeling lonely today? Can’t wait to get home to a loved one? Add a heart emoji to your bash prompt for a cheerful reminder.
Change your Bash Prompt
Your bash prompt is set with the
$PS1 variable in your
- Open up
~/.bashrcwith your favorite editor.
- Comment out the existing
- Add the following:
PS1='\[\e[35m\]❤\[\e[m\] \w $ '
\[\e[35m\] ... \[\e[m\]text sets the color to magenta/pink.
- Reload your bash profile with the command:
$ source ~/.bashrc
- Your prompt should now have a colorful heart! Hurray!