I would suggest setting your $PS1 to relevant information, like hostname, etc.
You can check your shell of choice's man page for details.
An example of things you could do to your PS1 in bash
I myself have a test in my ~/.subbash/prompt that sets the prompt's color based on server.*
*see __prompt_command() function
Ways You could change your PS1
There are any number of ways you can customize the PS1, It sound like you want something a little more noticeable, so my examples will be a little more complicated then just adding the \H
to the PS1. To use any of the following, you could add them to your ~/.bashrc
(on the remote servers, if not both. I sync the same conf between all my computers)
Note: To make these more readable, the following assumes that these vars are declared.
The var could easily be replaced with the contents.
Also, these examples are bash biased, you may have to tweak for other shells.
RCol='\[\e[0m\]' # Text Reset
Red='\[\e[0;31m\]' # Red
Gre='\[\e[0;32m\]' # Green
Yel='\[\e[0;33m\]' # Yellow
Blu='\[\e[0;34m\]' # Blue
Pur='\[\e[0;35m\]' # Purple
Cya='\[\e[0;36m\]' # Cyan
Whi='\[\e[0;37m\]' # White
Root Check
One thing you might like is test the $USER, for if it is root, or maybe a 'production' only account:
if [ $UID -eq "0" ];then
PS1="${Red}\h \W ->${RCol} " # Set prompt for root
else
PS1="\h \W -> "
fi
This would make the prompt red if you where root.
Host check
You could also test for information about the current machine, and set colors based on that:
PS1=
PSCol=
if [ $HOSTNAME == 'moving-computer-of-doom' ]; then
PSCol="$Cya" # For Main Computer
elif [ $HOSTTYPE == 'arm' ]; then
PSCol="$Gre" # For pi
elif [ $HOSTNAME == 'ma.sdf.org' ]; then
PSCol="$Blu" # For MetaArray
elif [[ $MACHTYPE =~ arm-apple-darwin ]]; then
PSCol="$Gre" # For iOS
elif [ $MACHTYPE == 'i486-pc-linux-gnu' ]; then
PSCol="$Whi" # For Netbook
elif [[ "$MACHTYPE" == "x86_64--netbsd" && "$OSTYPE" == "netbsd" ]]; then
PSCol="$Yel" # For Main Cluster
else
PS1+="\h " # Un-designated catch-all
fi
PS1+="${PSCol}\W ->${RCol} "
This would set the prompt cyan if on my laptop, green for my pi or iOS, etc etc.
If if wasn't listed, it would add the hostname to the prompt.
So if your production servers had something that was easy to test for (like a similar hostname, you could use that)
PROMPT_COMMAND
For the most part the above would work fine without this.
If you start adding things that you would want re-evaluated more often the login (maybe git status of a dir), you could use a PROMPT_COMMAND function to have the PS1 evaluated after each command.
The Above work fine without this.
Note: Sorry if these seem confusing, these are taken from settings I use, and modified to work without the rest of my settings.
Best Answer
The option has been included since version 3.0.0, and can be found at
Preferences > Advanced > Terminal: Visual bell flashes the whole screen, not just a bell icon
.