Last active
March 18, 2019 14:25
-
-
Save danielwestendorf/44420bf23b4368963d264e9618ad5a55 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# install bash-preexec | |
# curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh | |
# Add this (or source it) from your ~/.bashrc | |
[ -n "$PS1" ] && source ~/.bash-preexec.sh | |
preexec() { | |
if echo "$1" | grep -q -E "prod|ssh" ; then | |
echo -e "\033]50;SetProfile=Prod\a" # iTerm2 profile change, call AS or other here | |
fi | |
if echo "$1" | grep -q -E "staging" ; then | |
echo -e "\033]50;SetProfile=Staging\a" | |
fi | |
} | |
precmd() { | |
echo -e "\033]50;SetProfile=Default\a" # Revert to default | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment