Skip to content

Instantly share code, notes, and snippets.

@glennfu
Created September 30, 2014 21:18
Show Gist options
  • Save glennfu/8ee3cb9dc9ff0c837b9e to your computer and use it in GitHub Desktop.
Save glennfu/8ee3cb9dc9ff0c837b9e to your computer and use it in GitHub Desktop.
function precmd() {
echo -ne "\033]2;${PWD##*/}\a" # set window title to the current folder
return
}
function preexec() {
if [ "$1" = "rs" ]; then
echo -ne "\033]6;1;bg;red;brightness;180\a"
echo -ne "\033]6;1;bg;green;brightness;205\a"
echo -ne "\033]6;1;bg;blue;brightness;90\a"
elif [ "$1" = "rails c" ]; then
echo -ne "\033]6;1;bg;red;brightness;137\a"
echo -ne "\033]6;1;bg;green;brightness;190\a"
echo -ne "\033]6;1;bg;blue;brightness;244\a"
elif [[ "$1" = "heroku run"* ]] || [[ "$1" = "heroku logs"* ]]; then
echo -ne "\033]6;1;bg;red;brightness;200\a"
echo -ne "\033]6;1;bg;green;brightness;150\a"
echo -ne "\033]6;1;bg;blue;brightness;225\a"
fi
echo -ne "\033]1;$1\a" # set tab title to current command name
return
}
preexec_install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment