Get Instant Command Line Access from Anywhere in Mac OS with iTerm2
If you’re a command line user, you can imagine that it’d be useful to have a Terminal window available instantly to you from anywhere on the Mac, whether you’re currently in the Finder, Safari, Xcode, or any other application entirely. Well there’s no need to imagine, with iTerm you can have an instantly available terminal that drops down from the top of the Macs screen, giving you immediate command line access at the push of a hot key.
Maybe you need to quickly ping a server, use Homebrew, push git changes, reboot or shut down a remote machine, connect to a remote server with ssh, or any other quick task that requires the command line. Whatever the need, you can use this great trick to have an immediately available terminal window from anywhere or from within any application in Mac OS.
To get the drop-down command line, you will use a third party app called iTerm2, which is a popular third party terminal client for the Mac.
How to Setup Instant Command Line Access with iTerm2
- Download iTerm2 from the developer, place it into you /Applications/ folder, then launch iTerm2
- Pull down the “iTerm2” menu and choose “Preferences”
- Choose the “Keys” tab and click the “Create a Dedicated Hotkey Window” button
- Set your hot key keyboard shortcut as desired, or choose “Double-Tap Key” and set that accordingly, the example here uses a double-tap of the ‘Control’ key to access the drop-down command line panel
- Click “OK”, optionally go to the “Profiles” menu and customize the appearance by modifying the ‘Hotkey Window’ profile as desired
- Confirm the drop-down instant terminal window works as expected by pressing your hot key (double-tap Control key in this example)
- Dismiss the drop-down command line panel by clicking outside of the terminal window, or by hitting the hot key again
Once your hot key is set, you can toggle in and out of the drop-down command line from within any application in Mac OS, as long as iTerm2 is open in the background.
The dropdown command line is a standard shell with the full command line environment, tools, and utilities available to it, just like any other terminal window.
Aside from customizing the hot key, you can also customize how the drop-down command line looks by going to iTerm2 Preferences > Profiles > Hotkey Window and modifying the colors, fonts, and other settings as you see fit.
Our longtime readers may recall similar posts from quite some time ago about tools like Visor and TotalTerminal that have similar functionality, but iTerm2 is unique in that it’s a universally popular third party terminal application anyway, plus it’s compatible with all modern Mac OS versions.
If having an immediately available command line sounds interesting to you, check out iTerm2 and set up a hotkey, it’s pretty great!
Kristine how u get so smart
It’s nice to have so many choices of shortcuts to suit our preferences. As a 60% keyboard, Vim user and Ruby developer, I prefer fewest keystrokes to the closest keys and avoiding the mouse. Instead of arguing about what is best, realize it’s just personal preference!🤔
It takes less time to hit cmd-space, type ter and hit enter.
Perhaps you could enlighten the rest of us on how 6 key presses is faster than either a hotkey or a double tap hotkey, I fail to see it.
Well gee I dunno… A pre-loaded terminal app vs dling an app, messing with shortcuts configuring blah blah whatever else they have going on in the article.
Here I’ll better it.. Move mouse to search, type ter
Why not just keep Terminal in the dock?
I have a Logitech G300s and binding it to one of the buttons works great, thanks for the tip.
CMD + Space opens Spotlight (a tip itself) by the time you type ‘term’ spotlight has found terminal.app and press return and your there. Fingers never left the keyboard.
oh, nice…the look/feel reminds me of my old SGI Xterm days.
I know right! I was thinking the same thing! :)
Intersting. launching iterm2 via go2shell or similar would be useful.
https://itunes.apple.com/us/app/go2shell/id445770608?mt=12
Nice! Thanks for bringing this terminal app to my attention. I usually have Terminal and Activity Monitor in a desktop space in split view on my second monitor. But I’m going to try iTerm 2. A pull down terminal on my main monitor sounds like a good idea.