Skip to content

Instantly share code, notes, and snippets.

@savage69kr
Forked from wilmoore/readme.md
Created October 27, 2012 07:13
Show Gist options
  • Select an option

  • Save savage69kr/3963289 to your computer and use it in GitHub Desktop.

Select an option

Save savage69kr/3963289 to your computer and use it in GitHub Desktop.
Terminal Tab reflecting your current git project name

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.name

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

1

Your terminal tab when you are not in a configured project:

2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment