Auto-Profiles with iTerm2

Using Profile triggers to switch when SSH'ing

My favourite terminal is, without heasitation, iTerm2. Everytime I’ve switched to a new macOS, one of the first steps is always installing it. Right away.

Not only that the personalisation it offers is a delight, but also, the automatisation features to make your terminal experience a lot smoother.

I could jump in with all of those, but today I’d like to talk about one of the latest I’ve playing with: Profile Triggers.

But first, you must understand the meaning of the word Profile.

iTerm2 Profiles: a dress for every ocasion

A profile on iTerm2 is a set of features that are packed up altogether, so you can easily switch to another one easily.

image

Figure 1. Profile section

You always begin with the Default profile (seems legit), and as you can see on Figure 1, which contains pre-configured features such as the terminal’s colours and fonts, cursor types, bells, etc.

Let’s say you want to display a big red warning when going su -. You can do that: a nice

You can set up a shortcut to switch to a specific profile. Alright. But what if the change Moreover, what if you could open a specific SSH session to a Server when switching to a profile?

Make iTerm2 work for you