Live data from Hacker News

Little known features of iTerm2

banga.github.io

81–90 of 156 posts

Re: Little known features of iTerm2

#81

A couple more that I use often: * imgcat: you can view images without leaving your terminal. Somehow this works even across SSH connections… * 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).

imgcat and image displaying is amazing; I use a matplotlib backend that renders plots inline in the terminal, makes remote working much nicer.

Along with imgcat there’s it2dl. Downloads a file from the remote system browser-style. It’s much more convenient than scp, especially when several sessions deep.

Re: Little known features of iTerm2

#82

Earlier quoted context omitted.

I haven’t really figured out Tmux, and I’m a little ashamed to admit it. I usually reach for screen when needed, and disconnect/reconnect/kill are the only commands of screen I know. I’ll give the tmux -CC a go when I’m back at my machine, but what else does the integration do? I’m a heavy pane user - does the default split pane in tmux mode use tmux splitting for example?

Yes, splitting panes in iTerm will crate tmux panes on the remote. It's a pretty neat feature.

Even better, it also maintains multiple windows!

Re: Little known features of iTerm2

#83
post #34

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). 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. If you're SSHed into a server that has tmux installed,…

I use iTerm2 with tmux every day (but I don’t ssh into machines often nowadays) and I feel oppositely — I don’t get the attraction of the tmux integration. But maybe I still haven’t understood it, so please feel free to tell me what I’m missing. For me, the purpose of using tmux on my laptop is session, window, and pane management. (Perhaps my favorite tmux feature is zoom-pane.) So I find that the iTerm2 tmux integr…

I don't use tmux locally, but I find iTerm2+Tmux invaluable when it comes to managing my servers. for each of them I have an ssh command that automatically opens all the windows and panes for that particular server. It even persists colors I give various panes so I don't accidentally work in the wrong one.

Saves a bunch of time!

Re: Little known features of iTerm2

#84
post #34

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). 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. If you're SSHed into a server that has tmux installed,…

I use iTerm2 with tmux every day (but I don’t ssh into machines often nowadays) and I feel oppositely — I don’t get the attraction of the tmux integration. But maybe I still haven’t understood it, so please feel free to tell me what I’m missing. For me, the purpose of using tmux on my laptop is session, window, and pane management. (Perhaps my favorite tmux feature is zoom-pane.) So I find that the iTerm2 tmux integr…

I love tmux just for letting me run long running sessions on remote machines. I don't like tmux's window management, I want to use my terminal, scroll back with mouse, that kind of thing. Tmux integration is therefore for those of us who love their GUI terminal :)

Re: Little known features of iTerm2

#85
post #27

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 The other one being quicklook (space preview of files)

Weird thing to say, considering both Windows and Linux-based systems are way more developer-friendly.

(Windows due to VS and the rest of MS resources/docs/tools, Linux due to its package management systems natively supporting just about anything you could ever need for development. For macOS to compete, you need a plethora of best-effort or paid tools that don’t come from Apple).

Re: Little known features of iTerm2

#86
post #50

Earlier quoted context omitted.

These iterm image extensions are almost there. It is unfortunate that it can only display files, and not image created on the fly (i.e., you dump all the pixel values into the terminal and it shows an image).

The actual extension does support images created on the fly. All that's missing is some commandline tool that'll translate from whichever format it's in to the format iterm expects. For e.g. a PNG image data you could probably get away with a single-line bash script: all it has to do is stick an escape sequence in front of the base64 encoded file contents.

that's great! I hope it will be implemented for xterm and becomes a sort of standard. Sometimes I use "sixels" but they are hopelessly slow and low-resolution.

Not much a fan of the base64 encoding here. I'd prefer if it was the pixel binary buffer data that you output directly, pinching a hole in the terminal protocol. The fact taht it is binary does not pose problems if the escape sequence contains the size of the image.

Re: Little known features of iTerm2

#87

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). It also lets you Command+Drag a path to get a usable file-handle to drop into other apps that handle file-related dropzones. Demo video I made when I added the feature: https://vimeo.com/21872771

Can it extract the correct line number from tracebacks, compiler / linter output etc? I wrote this tool, but I know George Nachman has added some features since I wtote it: https://github.com/dandavison/iterm2-dwim

It should, I originally built it for rspec output but it should work with most common formats that put the line number attached to the path with a colon.

Re: Little known features of iTerm2

#88

Earlier quoted context omitted.

Really? I didn't think iTerm would pass along cmd keys, which is the primary reason I use MacVim instead. For example, I use these kinds of mappings: nmap nmap nmap nmap nmap nmap nmap nmap :CtrlP pwd nmap :CtrlPBufTag nmap :CtrlPMRUFiles This way, when on a Mac I can use cmd in place of ctrl for various commands I use all the time that are less convenient with ctrl. In my .gvimrc, I added the following to make sure…

Not a vim user but iTerm2 settings have a section for rebinding modifier keys, (plus you also have karabiner-elements)

I don't have karabiner-elements, but doesn't it basically just remap keys across your whole system (much like my mechanical keyboard can)?

I don't want change my cmd-keys into control keys system wide. I just want to be able to map my cmd-keys in vim (which to be honest is the lion's share of what I use any terminal for).

Re: Little known features of iTerm2

#89
post #36

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. https://www.iterm2.com/documentation-hotkey.html

I just discovered this last night! Such a cool feature.

Re: Little known features of iTerm2

#90

Cool article, but here I am don't know how to jump between words on iterm2

You can set this up as a shortcut. I forget exactly how I did it, but here's what seems to be a similar guide on macos:

https://coderwall.com/p/h6yfda/use-and-to-jump-forwards-back...

Post reply on HN