Skip to content

Instantly share code, notes, and snippets.

@vertan
Created July 10, 2018 15:21
Show Gist options
  • Save vertan/2422fb16c4225e7beb3f98c41737c1c6 to your computer and use it in GitHub Desktop.
Save vertan/2422fb16c4225e7beb3f98c41737c1c6 to your computer and use it in GitHub Desktop.
Dynamic Badge depending on environment in iTerm/SSH
# Put this in ~/.ssh/config
Host *.production.host.net
LocalCommand echo -e "\033]50;SetProfile=Production\a"
Host *.staging.host.net
LocalCommand printf "\033]50;SetProfile=Staging\a\e[0;m"
Host *
PermitLocalCommand yes
# End ~/.ssh/config
# In iTerm2
# 1. Create two new Profiles, "Production" and "Staging"
# 2. Keep defaults, but set Badge accordingly to "Production", "Staging"
# 3. (Optional) Set any other options for the specific environments.
# 4. Have fun in prod!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment