Skip to content

j4ckofalltrades/git-branch-win-title

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

git-branch-win-title

A small shell function that adds the current git branch (if present) to the terminal emulator window title.

Requirements

Quick Start

Configuration may vary depending on the user's OS, terminal emulator, and shell interpreter. But in most cases, the following command should be enough:

$ source branch-win-title.sh

You may also want to add this line to your shell configuration file e.g. .profile, .bashrc, .zshrc, etc.

Shell interpreter support

Terminal Emulator support

Tested on the following terminal emulators:

Additional configuration

Powerline

The branch-win-title.sh script must be loaded first before configuring powerline otherwise it will override the powerline-generated shell prompt.

Guake

Enable the following settings under Main Window:

  • Show tab bar
  • Use VTE titles for tab names

iTerm2

Enable the following settings under Preferences > Profiles:

  • Terminal may set tab/window title

Tmux

Add the following entries to .tmux.conf:

set-option -g set-titles on
set-option -g set-titles-string "#T"
set-option -g automatic-rename on

Demo