iTerm2
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](/blog/uploads/2020/12/iterm2_01.png)
First just open your iTerm 2 terminal.
![iterm2 02](/blog/uploads/2020/12/iterm2_02.png)
In the menu (top of your screen) click iTerm2, then preferences.
![iterm2 03](/blog/uploads/2020/12/iterm2_03.png)
Go to profiles, then select session. This is where you can enable the "Undo" option by giving it the time you like.
![iterm2 04](/blog/uploads/2020/12/iterm2_04.png)
I’ve set it to 30 seconds, giving me plenty of time to undo my stupid mistakes.
![iterm2 05](/blog/uploads/2020/12/iterm2_05.png)
So you accidentally closed your session? Just go to the top menu, click 'edit' and then 'Undo close session'. Or just click 'command-Z'.