Here is how it looks like in action:
username@hostname: Basic info.
- Time: I show time in my prompt so I can start a long-running job and go to lunch. The prompt will be displayed the moment the job returns, so I can subtract and see how long it took.
- Current directory: Gives me some context.
- git branch: I show it in blue when I am in master, purple otherwise.
- git status: I show a red star if the current directory is dirty.
$: The color indicates if the last command was successful. Green for success, red for failure.
So if I'm on the
release branch, has pending changes, and the last command failed, my prompt would look like this:
What do you show on your shell prompt?