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 :)

Comments (6)

  1. John wrote::

    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?

    Monday, February 22, 2010 at 8:40 pm #
  2. CharlyBr wrote::

    Which version of Mac OS are you running ?

    Wednesday, March 17, 2010 at 11:50 am #
  3. leoman730 wrote::

    The link is dead. Do you have an alternative?

    Friday, December 31, 2010 at 7:51 pm #
  4. tom wrote::

    link’s dead : (

    Monday, January 10, 2011 at 11:23 pm #
  5. CharlyBr wrote::

    I’ve updated my post.

    Thursday, February 10, 2011 at 11:06 am #
  6. Marius wrote::

    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\$ ‘

    Tuesday, July 26, 2011 at 10:14 pm #

Trackback/Pingback (1)

  1. Quora on Tuesday, July 26, 2011 at 4:33 am

    How can I display the file name in the tab of a VIM editor window?…

    First, what do you mean by “tab of a vim editor window”? This could mean many different things. But I suspect it means: – Vim running in a terminal window (text mode only, not gvim) – The terminal is a GUI application that offers tabbed-navigation Fo…