Utility for automatically naming windows/tabs of your tmux terminal.
The script automatically names your tmux tab using the following rules:
- When in a git project
- Use the name as specified in the of the origin
- Otherwise
- current directory name
- current parent and directory name
- current full path
You can test the script without making any modifications in your current $PS1
as specified in your rc file.
Start tmux/byobu and type
make
Alternatively you can just source the testing environment
source testing.sh
A testing $PS1
will be configured and you should see the title of your current tmux window change. Go and browse your filesystem.
- Copy file
tmux-titles.sh
into your home folder and source it from your rc file - Add
$(__tmux_title)
somewhere in your$PS1
For example
source ~/tmux-titles.sh
export PS1='$(__tmux_title)[\u@\h]\$ '
You can use the following functions from terminal in order to change the behavior of the script
ttdir
: automatically set the title to the current directory namettparent
: automatically set the title to using the two last directories in the current path.ttpwd
: automatically set the title to the present working directoryttoff
: disable automatic titles and reset current titlettset
: disable automatic titles and set current title to the specified first argument
- Option to disable git project detection
- Option to add relative path to current git project name