Recently, I’ve had to juggle multiple copies of a git repo because reasons. This has inevitably led to me accidentally running commands in the terminal in the wrong copy. So, to avoid this, I’ve written a bash profile script that will set my terminal windows to different colors based on the present working directory.
To use it, just stick it into your .bash_profile, then
In whatever directory you want to color
> dircolor “Some Terminal.app color profile”
This will place a .window_color turd in that directory.
Now, whenever you are under that directory, the window color will change.
You can rm .window_color to remove the turd if you no longer want to color the directory.