Created
January 7, 2015 19:33
-
-
Save syntruth/a954ec4c581137649f49 to your computer and use it in GitHub Desktop.
tmux prompt shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_title () { | |
host=`hostname -s` | |
# This is from the .git-prompt.sh file. | |
git=`__git_ps1 " [%s]"` | |
printf "${host}${git}" | |
} | |
set_title () { | |
title=`get_title` | |
tmux rename-window "${title}" | |
} | |
bash_prompt_command () { | |
set_title | |
} | |
PROMPT_COMMAND=bash_prompt_command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment