Since I’ve been working on a Mac, I replaced the default terminal with iTerm2. It provides some nice features like searching, autocomplete, or allowing to see images in the terminal. But this one is my favorite one, the undo close tab / session.

Why

Don’t you just hate it when you have multiple terminal tabs open, and accidentally close one? Just that one where you had an important process running, or tailing an error log? I do! :) This is just a short blogpost how iTerm2 helps me having more fun using my terminal. Actually it’s not much of a blogpost, this provides some screenshots. Sometimes an image says more than words.

How

iterm2 01

First just open your iTerm 2 terminal.

iterm2 02

In the menu (top of your screen) click iTerm2, then preferences.

iterm2 03

Go to profiles, then select session. This is where you can enable the "Undo" option by giving it the time you like.

iterm2 04

I’ve set it to 30 seconds, giving me plenty of time to undo my stupid mistakes.

iterm2 05

So you accidentally closed your session? Just go to the top menu, click 'edit' and then 'Undo close session'. Or just click 'command-Z'.

shadow-left