Created
September 30, 2014 21:18
-
-
Save glennfu/8ee3cb9dc9ff0c837b9e to your computer and use it in GitHub Desktop.
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
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