Skip to content

Instantly share code, notes, and snippets.

@syntruth
Created January 7, 2015 19:33
Show Gist options
  • Save syntruth/a954ec4c581137649f49 to your computer and use it in GitHub Desktop.
Save syntruth/a954ec4c581137649f49 to your computer and use it in GitHub Desktop.
tmux prompt shell script
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