A small shell function that adds the current git branch (if present) to the terminal emulator window title.
- Git v2.2 or higher
- Any supported terminal emulator
- Any supported shell interpreter
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.
Tested on the following terminal emulators:
The branch-win-title.sh
script must be loaded first before configuring
powerline otherwise it will override the powerline-generated shell prompt.
Enable the following settings under Main Window
:
- Show tab bar
- Use VTE titles for tab names
Enable the following settings under Preferences > Profiles
:
- Terminal may set tab/window title
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