Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to set the theme of the OS X Terminal depending on what you are doing? I would like to have visual cues to avoid making mistakes.

For example,

  • "pro" theme as default
  • "blue" if you are connected to another server via SSH
  • "red" if you have root rights
  • et cetera
share|improve this question

2 Answers 2

You can do what I suggest in this answer and programmatically change the themes of Terminal. Combine with shell aliases, scripts or functions that wrap calls to e.g. ssh to have automated theme changes.


You can also configure themes to execute specific commands when they're launched, so you get an "SSH Theme" executing ssh, a "root theme" that automatically runs sudo bash or something similar.

enter image description here

share|improve this answer

Adding lines like these in your .bash_profile should do the trick:

alias sudo="osascript -e 'tell application \"Terminal\" to set current settings of front window to settings set \"Red Sands\"' && sudo"
alias su="osascript -e 'tell application \"Terminal\" to set current settings of front window to settings set \"Red Sands\"' && su"
alias ssh="osascript -e 'tell application \"Terminal\" to set current settings of front window to settings set \"Ocean\"' && ssh"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.