TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Little known features of iTerm2

329 pointsby milkbikisabout 5 years ago

24 comments

nrclarkabout 5 years ago
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&#x27;t need to know anything at all about tmux to use iTerm&#x27;s tmux integration.<p>If you&#x27;re SSHed into a server that has tmux installed, try running `tmux -CC` on the server. It&#x27;ll pop up a new window that looks and feels just like it&#x27;s running natively (complete with tab support), except it&#x27;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 \ &#x27;sh -l -c &quot;exec tmux -CC -u new-session -AD -s remote&quot;&#x27; </code></pre> iTerm2&#x27;s tmux integration makes SSH access to remote machines feel almost as native as using your machine locally. It&#x27;s really a killer feature, and it made iTerm2 worth a donation for me.
评论 #22462836 未加载
评论 #22463455 未加载
评论 #22464510 未加载
评论 #22462370 未加载
评论 #22462834 未加载
评论 #22465183 未加载
评论 #22467868 未加载
评论 #22462926 未加载
评论 #22464587 未加载
snideabout 5 years ago
I was one of those vim users that was stuck on MacVim for years because my brain was too wired to hitting &quot;cmd-s&quot; 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 &quot;cmd-s&quot; 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&#x27;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&#x27;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&#x27;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:&#x2F;&#x2F;www.patreon.com&#x2F;gnachman" rel="nofollow">https:&#x2F;&#x2F;www.patreon.com&#x2F;gnachman</a>
评论 #22463255 未加载
评论 #22464850 未加载
raamdevabout 5 years ago
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&#x27; full screen windows. <a href="https:&#x2F;&#x2F;www.iterm2.com&#x2F;documentation-hotkey.html" rel="nofollow">https:&#x2F;&#x2F;www.iterm2.com&#x2F;documentation-hotkey.html</a>
评论 #22464837 未加载
评论 #22462869 未加载
评论 #22463892 未加载
saagarjhaabout 5 years ago
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&#x27;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).
评论 #22464626 未加载
评论 #22461958 未加载
评论 #22461971 未加载
评论 #22465043 未加载
评论 #22463588 未加载
评论 #22461902 未加载
yen223about 5 years ago
I&#x27;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.
评论 #22462267 未加载
评论 #22463433 未加载
评论 #22462970 未加载
评论 #22462190 未加载
gnachmanabout 5 years ago
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.
评论 #22466543 未加载
评论 #22465759 未加载
_chendo_about 5 years ago
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:&#x2F;&#x2F;vimeo.com&#x2F;21872771" rel="nofollow">https:&#x2F;&#x2F;vimeo.com&#x2F;21872771</a>
评论 #22461991 未加载
评论 #22463549 未加载
评论 #22461982 未加载
donatjabout 5 years ago
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
评论 #22462864 未加载
guessmynameabout 5 years ago
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:&#x2F;&#x2F;www.iterm2.com&#x2F;documentation-one-page.html" rel="nofollow">https:&#x2F;&#x2F;www.iterm2.com&#x2F;documentation-one-page.html</a><p>[2] <a href="https:&#x2F;&#x2F;www.iterm2.com&#x2F;donate.html" rel="nofollow">https:&#x2F;&#x2F;www.iterm2.com&#x2F;donate.html</a>
Myrmornisabout 5 years ago
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:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;iterm2-dwim" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;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&#x2F;linter output, tracebacks, git output, etc.<p>Currently Emacs, PyCharm and Sublime are supported.
评论 #22463059 未加载
mark_l_watsonabout 5 years ago
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:&#x2F;&#x2F;leanpub.com&#x2F;hy-lisp-python&#x2F;read#leanpub-auto-bonus-points-configuration-for-macos-and-iterm2-for-generating-plots-inline-in-a-hy-repl-and-shell" rel="nofollow">https:&#x2F;&#x2F;leanpub.com&#x2F;hy-lisp-python&#x2F;read#leanpub-auto-bonus-p...</a>
aloerabout 5 years ago
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)
评论 #22462127 未加载
评论 #22463653 未加载
shabbyrobeabout 5 years ago
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 &quot;fireworks&quot;! [1]<p><pre><code> ^[]1337;RequestAttention=fireworks^G </code></pre> [1]: <a href="https:&#x2F;&#x2F;iterm2.com&#x2F;documentation-escape-codes.html" rel="nofollow">https:&#x2F;&#x2F;iterm2.com&#x2F;documentation-escape-codes.html</a>
评论 #22463229 未加载
wincyabout 5 years ago
I thought I was being fancy when I figured out I could use CMD+shift+c to get vim-style visual selection to yank some terminal output in a pinch.
ashton314about 5 years ago
iTerm2 is going to be the killer app that keeps me on macOS for a long time. Is there anything remotely as good for Linux systems?
Corradoabout 5 years ago
I love iTerm2 and have been using it for years. Thanks to this post I&#x27;ve even learned a couple of new things that make me love it even more.<p>One thing I&#x27;ve been trying to get working in iTerm2 has been AWS profile badges. iTerm2 has the ability to use text &quot;badges&quot;[0] to give feedback about the current environment. I&#x27;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&#x27;t been able to get it to work.<p>[0] <a href="https:&#x2F;&#x2F;iterm2.com&#x2F;documentation-badges.html" rel="nofollow">https:&#x2F;&#x2F;iterm2.com&#x2F;documentation-badges.html</a>
评论 #22465694 未加载
bad_userabout 5 years ago
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&#x27;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&#x27;s powerline package to work from the terminal than it was to work from the GUI version.<p>I also like iTerm2&#x27;s tmux integration.<p>iTerm2 is one of the reasons why I won&#x27;t abandon MacOS for my software development needs anytime soon.
评论 #22494945 未加载
locusofselfabout 5 years ago
tmux -CC support is my favorite feature of iTerm2. It&#x27;s amazing.
评论 #22462619 未加载
评论 #22462095 未加载
cs02rm0about 5 years ago
Anyone else have any problems getting the first one to work?<p>I could run <i>&#x2F;usr&#x2F;local&#x2F;bin&#x2F;hub browse -- commit abc123</i> without issue, but iTerm wasn&#x27;t even changing to cursor when hovering over a hash and holding cmd.
评论 #22463523 未加载
babayega2about 5 years ago
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&#x2F;horizontal split.
评论 #22462208 未加载
评论 #22462313 未加载
dzhiurgisabout 5 years ago
I love iTerm!<p>I&#x27;ve wondered whether it&#x27;s possible to setup profile-specific (or folder-specific) aliases? I understand it might be zsh feature that I&#x27;m really after, but perhaps iTerm can solve it too?
评论 #22463562 未加载
评论 #22463100 未加载
sk0gabout 5 years ago
I&#x27;m a little jealous of iTerm, not going to lie. The UX is pretty nice from what I&#x27;ve seen, but I can&#x27;t find a like for like replacement for either Windows or Linux.
评论 #22461945 未加载
评论 #22461996 未加载
评论 #22462016 未加载
评论 #22461921 未加载
评论 #22462342 未加载
评论 #22461925 未加载
andreareinaabout 5 years ago
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.
freakcageabout 5 years ago
Cool article, but here I am don&#x27;t know how to jump between words on iterm2
评论 #22463935 未加载
评论 #22465891 未加载