I’ve just spent some time customising my BASH prompt. In fact I wrote a 111 line BASH script to set it up. And I suspect it’s going to get longer
.
For now it’s got:
Username, highlighted red when you’re root (e.g. sudo -s)
Hostname, highlighted red when (the prompt thinks that) you’re sshed into a remote machine
The Path of the CWD (of course)
Some Git information (when in a Git repo), the current branch, current HEAD’s SHA (abbreviated), and whether there are any unstaged changes/untracked files, and if there are any staged changes.
I’ve put it up on github as a gist: prompt.sh
Advertisement