Is there a command that can be used to change the color scheme of the Mac OS X Terminal? I like the idea of being able to change colors depending on scripts I run. So far I am just changing the color of my bash prompt with PS1 which is okay but not as noticeable as I'd like.
Depending on what exactly you want to accomplish, here's a few ideas in AppleScript using your Terminal styles. These are more robust than
This sets all tabs running Python (no SSH server available for testing right now) to Homebrew, the others to Ocean:
save as script and run as
If you want to display all long-running processes differently, use the following condition:
Or, you can set the style of a single tab, manually selected:
Run it like this:
-> Third tab of frontmost Terminal window gets Homebrew style!
If you want to modify background windows, replace "front window" with a parenthesized expression like just after "tab".
If you always want to modify the selected "current tab", use
Add the following to your
Now it gets executed before every prompt (only problem: not after starting something, i.e.
Your scripts can use the
You can see more information about this in
You can do the same things by echoing the escape sequences that your terminal recognizes directly. It will be faster, but it may not work using another terminal program. Many of them recognize xterm sequences and here is what the script above would look like using them.
There's more information on xterm control sequences here.
The following article can be used as an example for changing the color theme:
This article relates to both Leopard and Snow Leopard.