There are a lot of new features in 3.0. It represents about eighteen months of development. Here are the highlights.
A Fresh Look
iTerm2 has been updated for the modern Mac OS X “flat” look and is stunningly beautiful.
Shell Integration is a modification to your shell’s login script that informs iTerm2 of which commands you’re running, which host you’re logged in to, what your user name is, and what your current directory is. This enables all kinds of cool features, such as easily navigating to preceding shell prompts, getting a notification when a long-running job finishes, drag-dropping files to upload and download on remote hosts, and much more. All the details are at the Shell Integration document.
Automatic Profile Switching
iTerm2 can change your profile (for example, affecting the color of your terminal) when you ssh to a remote host, when you run sudo, or even depending on your current directory. Automatic Profile Switching is part of Shell integration.
Session Restoration allows your jobs to keep running after iTerm2 upgrades, is force-quit, or crashes. It’s like tmux without tmux!
Using the imgcat script, iTerm2 can display image files right in the terminal–even animated GIFs. See the Inline Images document for details.
iTerm2 version 3 introduces the concept of a Badge. A badge is user-defined text that goes in the top-right of your terminal behind its content and can display information like your current host name or git branch. Learn more about badges.
The built-in Password Manager saves you from having to remember lots of passwords. It uses Mac OS’s keychain to securely store them, and has built-in guards to prevent them from being accidentally transmitted when not at a password prompt. You can even write a Trigger that automatically opens the Password Manager at the password prompt.
Undo closing sessions, tabs, and windows. If you close a session by accident, you get five seconds to hit Cmd-Z to undo it.
Tab Bar on Left
Have lots of tabs? Put the tab bar on the left. Quickly search them by recent commands, directories, current host name, profile name, and more with the Open Quickly feature.
Dynamic Profiles allow you to store profiles in JSON files. This is really handy if you have lots of profiles or want to auto-generate them. See the Dynamic Profiles document for details.
Cursor Location Assistance
Never lose your cursor. An optional cursor guide highlights the entire row your cursor is on and Cursor Boost dims all colors other than the cursor to make it really stand out.
iTerm2 tracks the last-modified time of each line in history so you can see how long commands took to run or when error messages were printed.
Use iTerm2 as your IDE. You can define regular expressions to match lines of text like error messages from a compiler. The matching lines are shown in the toolbelt on the side of your terminal. You can click to jump to the line or double-click to run a coprocess, which can open the file in your favorite editor right to the line number you need. Learn more about Captured Output.
All the Small Things
Performance is greatly improved by parsing the incoming bytes off the main thread. Hundreds of bugs have been fixed. Lots of details have been improved: for example, if you print a binary file to the console, you’re offered the option to silence the bell. You can edit strings before you paste them. You get warned before pasting tabs at your shell prompt. And much more!
Although Applescript has changed, you can still get Alfred to work. Go to Alfred Preferences and choose Features. Pick Terminal/Shell and for Application choose Custom. Then paste the iTerm2 3.0 Alfred Script into the text field. Perhaps a crude illustration will help.
Applescript Not Backwards Compatible
The good news is that iTerm2’s Applescript makes a lot more sense than it used to. You can manipulate split panes, and scripting will receive more love and support in the future.
The bad news is that existing Applescript won’t work any more.
The good news is that it’s pretty easy to fix.
The new Applescript syntax is described here.