2

I'd like to be able to set the titles on my tabs to short, easy-to-remember things, since I often have a few open. You can use Command-I and set the Title that way, but OSX appends the name of the currently running process to that title, (e.g. "test title -- bash").

Is there any way to set the full text of the tab title?

This is on OSX 10.6. There used to be a way to do this on 10.5 using SIMBL, but that no longer works.

3 Answers 3

3

In Preferences choose the windows tab for your set of settings. There is an option Active process name - if this is not ticked then you should not see the command in the title bar.

3

I turned off, 'show active process' in preferences. Along with all the other trivia. I want different trivia.

As an example, I have the following two lines in my .bash_profile in my home directory. (.bash_profile gets executed in every new tab/window)

PROMPT_COMMAND='echo -n -e "\033]0;`basename $PWD`\007"'
function vi { echo -n -e "\033]0;vi $1\007" ; vim $1 ;}

The first command sets the tab to the last directory in my current bath. e.g. if I'm in ~sherwood/foo/bar this will be bar

The second one in effect turns vi (my editor of choice) into a pair of commands that does the same sort of echo, but now it sets the tab to show that I'm editing this file. So if I'm editing ~sherwood/foo/bar/baz, it will show vi baz

Note that it will show whatever you told vi. So if you type vi /some/long/path/to/a/../../name that's what the tab will show, or at least as much of it as will fit.

At this time I have not found a way to set the title bar differently from the tab.

1
  • Oh, I am not very good at bash. Can you, please, tell how to title current tab with current directory where I stay? Jun 19, 2013 at 10:43
1

You could install xtermcontrol (also via fink, macports, etc.), and then use that to set the title to whatever you want. I have the following cd in my .bash_profile, so that any time I change directories the directory is in the xterm window title:

cd() {
  if [ -n "$1" ]; then
    builtin cd "$@"; xtermcontrol --title "$@"
  else
    builtin cd ~;  xtermcontrol --title "~"
  fi
}

You can also set up aliases or customize your ssh settings so that hostnames are added to the title when you leave this host, etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .