Not sure whether or not this is a little-known feature. iTerm2 has _fantastic_ integration with tmux (software used for persisting a terminal session across multiple logins).<p>Tmux can be a pretty complex piece of software, but iTerm can basically wrap it all up into a nice package. You don't need to know anything at all about tmux to use iTerm's tmux integration.<p>If you're SSHed into a server that has tmux installed, try running `tmux -CC` on the server. It'll pop up a new window that looks and feels just like it's running natively (complete with tab support), except it's all tunneled over SSH.<p>And if you disconnect, you can just reconnect later and your windows will all come back in the same state as when you left them.<p>I use this one-liner to SSH into a server and reconnect (or start) a tmux session:<p><pre><code> ssh -XY -F user@hostname -Ct \
'sh -l -c "exec tmux -CC -u new-session -AD -s remote"'
</code></pre>
iTerm2's tmux integration makes SSH access to remote machines feel almost as native as using your machine locally. It's really a killer feature, and it made iTerm2 worth a donation for me.
I was one of those vim users that was stuck on MacVim for years because my brain was too wired to hitting "cmd-s" for save and other dedicated app niceties. I mean, sure I can :w or bind it to another key, but there are a couple shared OS-level shortcuts like this I just like to retain. No worry, iTerm2 can capture ANYTHING, and rebind it as needed. This means I have a few remaps like "cmd-s" in iterm2 to map to obscure key combinations, which I then have vim interpret and pass along to whatever I want to bind over there. I had no idea the feature existed for years. And sure, I know you're all laughing, why would I even do such a thing... but vim is vim, and we all have our own weird version of it.<p>iTerm2 is amazing. I've been using it for years daily and it is 100% one of the best, most reliable pieces of software in my toolkit, right next to Alfred.<p>Show you love for George and contribute to his Patreon[0]. We always love to complain about how to make money with open source on HN. I'd love to see him making a lot more than he does, if for no other reason than we can get more people working full time on the project and provide some redundancy for a critical tool we all love. I wish I could pay for it, but I guess Patreon works.<p>[0]: <a href="https://www.patreon.com/gnachman" rel="nofollow">https://www.patreon.com/gnachman</a>
I’m surprised to see that the iTerm2 dedicated hotkey window hasn’t been mentioned. It’s essentially a system-wide terminal window that you can open with a hotkey, similar to the old Visor app, and you can configure it as a floating window that appears over other apps' full screen windows. <a href="https://www.iterm2.com/documentation-hotkey.html" rel="nofollow">https://www.iterm2.com/documentation-hotkey.html</a>
A couple more that I use often:<p>* imgcat: you can view images without leaving your terminal. Somehow this works even across SSH connections…<p>* Python scripting API: basically AppleScript for iTerm except it lets you touch pretty much everything and it's not soul-crushing to write. I have mine switch between themes based on the system appearance (which changes based on the time of day).
I've found a lot of use from cmd-shift-e, which shows timestamps for each output line in the terminal. Great for figuring out how long a process ran for.
Hi, author here. What a great way to wake up, an HN love fest :) Check our the Tip of the Day feature, which is meant to help you find stuff like this.
Semantic History is pretty handy and not well-known. It lets you Command+Click on a path to open it in your editor (or associated application).<p>It also lets you Command+Drag a path to get a usable file-handle to drop into other apps that handle file-related dropzones.<p>Demo video I made when I added the feature: <a href="https://vimeo.com/21872771" rel="nofollow">https://vimeo.com/21872771</a>
This feels like a dumb question, but is the text rendering really dark for others in iTerm2? It seems like on a black background I cannot get pure white text. It’s always a middle shade of gray for me - before and after getting a Retina display.<p>I have messed with the colors and text rendering for literal hours over the last ten years and I genuinely cannot get it as clear and readable as Terminal.app which is a big part of the reason I always end up falling back to Terminal
iTerm2 has so many features [1] I don’t think I have enough space here to promote them all.<p>Please consider setting up recurrent donations to George Nachman [2] to support his work.<p>[1] <a href="https://www.iterm2.com/documentation-one-page.html" rel="nofollow">https://www.iterm2.com/documentation-one-page.html</a><p>[2] <a href="https://www.iterm2.com/donate.html" rel="nofollow">https://www.iterm2.com/donate.html</a>
A little plug: iterm2-dwim is a click handler that makes use of the iTerm2 smart selection feature to open files in your editor at the correct line.<p><a href="https://github.com/dandavison/iterm2-dwim" rel="nofollow">https://github.com/dandavison/iterm2-dwim</a><p>From the README:<p>iterm2-dwim is a click handler for iTerm2. The aim is that you command-click on any file path, relative or absolute, and it opens the file in your editor. If there was a line number, your editor goes to that line. So, compiler/linter output, tracebacks, git output, etc.<p>Currently Emacs, PyCharm and Sublime are supported.
For me, the killer feature is supporting inline plots in a shell, in a terminal-based Emacs session, etc. I have a short section in my latest book on setting it up, which you can read free online: <a href="https://leanpub.com/hy-lisp-python/read#leanpub-auto-bonus-points-configuration-for-macos-and-iterm2-for-generating-plots-inline-in-a-hy-repl-and-shell" rel="nofollow">https://leanpub.com/hy-lisp-python/read#leanpub-auto-bonus-p...</a>
I’ve said it before: iterm2 is one of the two reasons I feel so much more productive on mac compared to Windows or Ubuntu<p>The other one being quicklook (space preview of files)
iTerm2 is fantastic! It can be a bit CPU hungry but you get a stack of mod cons out of the bargain.<p>There are tons of proprietary escape codes, not least of all the incredibly useful one for "fireworks"! [1]<p><pre><code> ^[]1337;RequestAttention=fireworks^G
</code></pre>
[1]: <a href="https://iterm2.com/documentation-escape-codes.html" rel="nofollow">https://iterm2.com/documentation-escape-codes.html</a>
I love iTerm2 and have been using it for years. Thanks to this post I've even learned a couple of new things that make me love it even more.<p>One thing I've been trying to get working in iTerm2 has been AWS profile badges. iTerm2 has the ability to use text "badges"[0] to give feedback about the current environment. I'm an AWS engineer and tend to switch between environments a lot, so I thought it would be great to use the badges functionality to let me know when I was in the production environment vs. say, the development environment. This seems pretty simple but I haven't been able to get it to work.<p>[0] <a href="https://iterm2.com/documentation-badges.html" rel="nofollow">https://iterm2.com/documentation-badges.html</a>
iTerm2 is what made me finally use Emacs in the terminal, completely replacing vim for me.<p>You can configure Emacs when running from the terminal to respond to mouse input or to integrate with the system's clipboard. You make it run in server mode, via a Launchd config and you get instant startup times too.<p>iTerm2 also has built-in powerline glyphs. It was actually easier to configure Emacs's powerline package to work from the terminal than it was to work from the GUI version.<p>I also like iTerm2's tmux integration.<p>iTerm2 is one of the reasons why I won't abandon MacOS for my software development needs anytime soon.
Anyone else have any problems getting the first one to work?<p>I could run <i>/usr/local/bin/hub browse -- commit abc123</i> without issue, but iTerm wasn't even changing to cursor when hovering over a hash and holding cmd.
Question. Do you know how to get iTerm2 to open on split into the same directory that it was in like in Terminator on Ubuntu? Currently it always open to home directory whether I do a vertical/horizontal split.
I love iTerm!<p>I've wondered whether it's possible to setup profile-specific (or folder-specific) aliases? I understand it might be zsh feature that I'm really after, but perhaps iTerm can solve it too?
I'm a little jealous of iTerm, not going to lie. The UX is pretty nice from what I've seen, but I can't find a like for like replacement for either Windows or Linux.
iTerm2 has (had? I stopped using it a while ago) the tendency to drop data from a large paste. No problems with the built-in Terminal.app so I just went back to that.