NOTE: the potential downside to this approach is that git is a requirement; however, this is simple to extend for other VCSes.
First, setup a git alias:
% git alias project-name '!git config project.info.name'Use it like this (your CWD should be a git project):
% git project-name "NodeJS Latest"Review the setting with:
% git config --local --get project.info.nameIn your bash profile:
% export PROMPT_COMMAND='echo -ne "\033]0;$(git config --get project.info.name || echo -ne "$USER@$HOSTNAME")\007"'Your terminal tab when you are within a configured project:
Your terminal tab when you are not in a configured project:

