Set Terminal tab title in Mac OS X

Picture 2

I wrote previously a how-to to set your iTerm tab title.

I finally found a tool to do the same thing with the default Mac OS X Terminal.

Check it out here, it works perfectly for me!  link is dead.

On my Mac OS X 10.6.6 and bash (3.2.48(1)-release), you can set your tab title with the PROMPT_COMMAND variable as follow:

export PROMPT_COMMAND=’echo -ne “\033]0;${USER}@${HOSTNAME%%.*}\007″‘

Add this to your .bashrc or /etc/profile file and you’re done 🙂

 
  • I was happy to find this, but after installing, un-commenting the defaults in the conf file and running the command, my tabs haven’t changed. Something I’m doing wrong?

  • CharlyBr

    Which version of Mac OS are you running ?

  • leoman730

    The link is dead. Do you have an alternative?

  • tom

    link’s dead : (

  • CharlyBr

    I’ve updated my post.

  • Pingback: Quora()

  • Marius

    Overriding PROMPT_COMMAND is a bad idea… OS X uses it to update internal directory/command variables it uses.

    It can all be done via the PS1 variable anyway:

    export PS1=’\e]0;\u@\h\a\W\$ ‘