Having the process automatically set the name of the terminal in OSX almost never works for me. A little googling turned up the bash sequence for setting the process name in the terminal.
echo -n -e "\033]0;TerminalName\007"
This command will set the name of the terminal to “TerminalName.”
Instead of trying to remember this string, I created a little shellscript:
#!/bin/bash
echo -n -e "\033]0;$1\007"
I called this script setname
and put it in /usr/local/bin
. Then you can call it with:
setname TerminalName