Manually Set the Terminal Title in OSX

Posted by Tejus Parikh on March 14, 2010

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

Tejus Parikh

I'm a software engineer that writes occasionally about building software, software culture, and tech adjacent hobbies. If you want to get in touch, send me an email at [my_first_name]@tejusparikh.com.