Apple - Change terminal color for each tab

The built-in default "Solid Colors" profile randomly selects a background color for each new terminal.

It works by setting the background image to a folder of images, each of which is a solid color. To choose different colors (or patterns, etc.) you can place a collection of images in a folder and set a profile to use the folder in

Preferences > Profiles > [profile] > Text > Background > Image:

Another feature of profiles is that if you create a new terminal with Shell > New Command or New Remote Connection it will look for a profile with a matching name and select that profile. It will look for a match of the entire command string, a partial match of the command name and arguments starting from the left, and it will also try to interpret the profile name as a regular expression.

This means you can name a profile “ssh” to have it selected for any ssh command, or “ssh hostname” for ssh commands whose first argument matches hostname, for example.


I would highly recommend using iTerm2 I'm still finding cool new features. I don't know about a truly random background color, but I know you can change your settings based on user, host, file system location. Though, that feature may still be in beta.

Yes, that's still in beta:

Automatic Profile Switching Using the Shell Integration feature, you can have iTerm2 switch profiles depending on what you're doing. For example, you can define a profile that's always used when you ssh to some hostname. Or when your username is root. Or even when you're in a particular directory.

Tags:

Terminal

Color