9 ms·
iTerm2 Shell Integration
- nvk 11y agoThanks for this.
- callesgg 11y agoThat is actually some really nice features that i could see myself using on a daily basis. However i feel that it might somehow fuck up some things, as it is using some rather unconventional stuff.
- msoad 11y agoClick to download or drop in to upload is really nice! I'm excited for this! BTW if you're using iTerm, be aware that ⌘+clicking on a link will open the link in browser or ⌘+clicking a file in `ls` result will open the file with default app.
- JonnieCache 11y agoEven better, cmd clicking on a ./path/file:line string will open in your editor at that line. Perfect for backtraces.
- s800 11y agoright-click to scp is particularly neat.
- sneak 11y agoExcept that it doesn't shell out, so it ignores ProxyCommand...
- gnachman 11y agoWhat do you use ProxyCommand for? It seems hard to support, but I'd like to know more.
- lclarkmichalek 11y agoI've used it in the past to ssh via bastion hosts and the like.
- mturmon 11y agoYes. My config is something like this: # proxy n02 connections through bastion host n02.university.edu ProxyCommand ssh bastion.university.edu -W %h:%p 2> /dev/null Almost all my remote shells require a similar setup.
- gnachman 11y agoSeems like this might be a common enough pattern that I could support it. I'll have a look.
- devonkim 11y agoYou can also use ProxyCommand to perform filtering via sed / awk / some shell script on the hostname passed in. Examples: https://wiki.gentoo.org/wiki/SSH_jump_host https://wiki.gentoo.org/wiki/SSH_jump_host I have over 300 hosts defined in my .ssh/config file and it's indispensable to have all these options, especially when mixing in 2FA jump hosts into the mix.
- sneak 11y agoI also use a smartcard with gpg-agent speaking the ssh-agent protocol. OpenSSH commandline supports it fine. What's the harm in shelling out?
- gnachman 11y agoI don't get to control the UI if I shell out. I want to prompt you for your password in a native window and display a native progress bar. I want to know exactly why it failed. I want to estimate the time remaining.
- 11y ago
- tonyedgecombe 11y agoI'd love to see something like iTerm for Windows.
- jimmcslim 11y agoFWIW, Microsoft have given the command prompt some love in Windows 10. http://www.hanselman.com/blog/Windows10GetsAFreshCommandPromptAndLotsOfHotkeys.aspx http://www.hanselman.com/blog/Windows10GetsAFreshCommandProm...
- deleted 11y ago[deleted]
- RoboSeldon 11y agoNot exactly an iTerm2 clone but pretty close conemu https://code.google.com/p/conemu-maximus5/ https://code.google.com/p/conemu-maximus5/
- codereflection 11y ago+1 for conemu. It's approach and direction seem to be different than iTerm2, but still a must have on Windows.
- djKianoosh 11y ago+1 for conemu/cmder plus git bash on windows. again, different than iterm2 but also a must have
- tracker1 11y agoI love conemu, with a git-bash prompt it's about priceless. In case anyone is looking for something similar for Explorer, I've been using a program called Clover for a while. Linking to the alternativeto page for it, since it's free, but closed source... http://alternativeto.net/software/clover/?platform=windows http://alternativeto.net/software/clover/?platform=windows
- keypusher 11y ago
- themodelplumber 11y agoFunny how we just finished a discussion about "why haven't you switched to Fish yet," and now this comes along with not-fully-baked Fish support. :)
- gnachman 11y agoUpdate: I just tested it and fish 2.2 works great out of the box. I haven't had a chance to test it yet, but I believe fish 2.2 will allow the baking to finish. Fish cleverly parses the prompt to figure out how long it is (vs bash which requires you to wrap nonprinting sequences in \[ and \]). Unfortunately fish's support for OSC codes was incomplete. This was a problem because shell integration uses them to report the current directory, hostname, prompt location, etc., so fish would wrap at the wrong location. I submitted a patch a while back, but I can't very well ask people to run a hacked version of their shell. So until a few days ago it was half baked. Now it's like 90% baked :)
- themodelplumber 11y agoCool, thanks for the update :)
- taternuts 11y agoI didn't know about the Toolbelt, that's pretty useful. It'll be really awesome to have history + recent directories integrated
- gnachman 11y agoI'm here to answer questions anyone has about this. It's a newish feature so feedback is welcome, and bug reports are greatly appreciated. Also, credit goes to FinalTerm for the inspiration. RIP.
- lemevi 11y agoAs an iterm2 and fish shell user I appreciate the work you guys are doing on bringing this to fish. Thank you! :)
- Tombar 11y ago+1
- matt4077 11y agoI'm using a german keyboard and the shortcut cmd-; is inaccessible because ';' is shift-, I couldn't find a way to customise the shortcut in options. Sorry if I was too stupid to find it. Great work otherwise.
- hmottestad 11y agoSame here in Norway (and the entire Scandinavia).
- kawsper 11y agoLots of stuff seems broken by default if you are on an exotic layout. I am on a Macbook with a Danish-layout, and ALT+ARROW_LEFT/ARROW_RIGHT doesn't work out of the box in iterm2, however it seems to work if you rebind, or type this into .inputrc: "\e\e[D": backward-word "\e\e[C": forward-word I'd love to switch to an american keyboard, because lots of Unix things seems impossible to type with my current keyboard, but maybe I am just being stupid.
- pi-rat 11y agoI switched from a Norwegian keyboard to a UK keyboard with intl. English map on my MacBook. Default keyboard shortcuts suddenly made so much more sense - and I can code without having to use my nose when I run out of fingers for modifier keys. ()[]{}\|/:;' are all available using at most a single modifier (many of them without). Scandinavian characters are available using a single modifier for when I don't code, ex alt-a for å. Definitive productivity boost for me.
- kzhahou 11y agoCongrats, team! iTerm2 (esp in fullscreen mode) is THE reason I could never go back to windows development.
- ryenus 11y ago+1 I used to use cygwin on windows with screen, it kinda works, just everything is so slow. Every time I create a new screen window I had to peek HN for latest posts. LoL
- pixelbeat 11y agoThe popup on command completion is a neat feature actually which I've appreciated in gnome-terminal on Fedora 22, nicely integrated into the notification system
- hesslau_ 11y agoI'd love to use a terminal with similar features on linux
- stephen-mw 11y agoI found iterm2 to be my most-missed piece of software when switching to linux desktop. Terminator just doesn't compare with ease-of-use, look, and feel. Gnome terminal is nice but lacks some of the rich features.
- Watabou 11y agoTerminator comes close, but to be honest, iTerm2 still beats it with its user friendliness and features. It's really interesting how OS X is the one that has a terminal emulator with the most features out there. iTerm2 now comes with 24-bit colors, command completion popup, notifications, triggers, profiles, mouseless copy, split panes, search, and you can even have inline images/gifs all out of the box with zero or minimal configuration required. That's just awesome. All of these features and iTerm2 still feels much faster than Terminator to me.
- rhubarbquid 11y ago> It's really interesting how OS X is the one that has a terminal emulator with the most features out there. In my experience, the vast majority of web developers use OS X. Those of us doing server side and devops work spend a lot of time in the terminal
- mariusmg 11y ago"It's really interesting how OS X is the one that has a terminal emulator with the most features out there." Actually that will be Windows with ConEmu. You can even run GUI apps inside the terminal with it.
- DiabloD3 11y agoWhen I still used Linux on the desktop, I just used urxvt.
- JustinAiken 11y agoWow guys, this is great... I'd manually tried setting something up with PushBullet for a few long running commands, but just hitting a shortcut combo is much nicer... brew installs and bundle installs and the like will be a joy now!
- DiabloD3 11y agoI'm concerned about the wget to an external server part. This file should be local to prevent excessive slowness and potential security issues. Also, is there a zsh version of this file? zsh is extremely popular on osx.
- gnachman 11y agoThe linked page explains how to install by hand. I'd like to eliminate the curl|bash. It's tricky to deploy a shell script in a terminal emulator, so it hasn't been done yet. The ability to fix bugs without making users upgrade their client has been invaluable during early beta.
- glenjamin 11y agoWould it be possible for iTerm to "type" the whole thing in for me? It's already executing a curl, can it do the whole thing through the host?
- gnachman 11y agoThat's the eventual plan. There are a million niggling details, so I didn't do it yet.
- DiabloD3 11y agoWell, if all I have to do is run the script, I can just import it into my git repo (by submoduling iterm2's git repo, if they have one; if they don't, they need one just for this script), and just call it normally (with a bit of if wrapper to not execute on non-iterm2 terms).
- gnachman 11y agoYes, all you have to do is source the script at https://iterm2.com/misc/${SHELL}_startup.in https://iterm2.com/misc/${SHELL}_startup.in from your ~/.login, ~/.zshrc, ~/.bash_profile, or ~/.config/fish/config.fish as appropriate. If there's ever a major change you'll get a notification when you log in and you'll need to update it, but that hasn't happened yet.
- soundjack 11y agoGreat stuff, I've been using iTerm2 for a while and it's really good to see it evolve like this. I use screen a lot (yes I know, I should switch to tmux one day!) and shell integration doesn't seem to work properly with sessions inside screen. Works perfectly if I ssh directly. Is it going to be supported eventually or is this the ultimate signal for me to switch to tmux?
- gnachman 11y agoBy default, it is disabled in tmux. It works fine in iTerm2's tmux integration mode, but not in plain old tmux. I'm hopeful that this feature will prove popular and useful enough that I can get tmux to add support for it. To make it work in tmux integration mode just remove the check that $TERM == "screen" in $HOME/.iterm2_shell_integration.$SHELL.
- brainslug 11y agoThanks for the tip. Unfortunately, right clicking on a mark is not working in tmux integration mode.
- baconhigh 11y agoI like the idea of these features, but the "run this random shellscript from the internet" part really bugs me. Could / will you integrate it another way when it comes out of the nightly releases?
- JohnBooty 11y agoTotally reasonable thing to ask, but if you'd scrolled down a few more pixels you'd have had your answer. Directly underneath: The easiest way to install shell integration is to select the iTerm2>Install Shell Integration menu item. It will download and run a shell script as described below. ...you'll see: "Don't care for piping curl to bash? Do it by hand. First, download the right script for your shell...."
- rockdoe 11y agoAt least it's being served over HTTPS :-)
- neuropie 11y agoIt is until you look at the script it downloads, which downloads further scripts over HTTP.
- sgarrity 11y agoDoes it work with mosh (https://mosh.mit.edu/ https://mosh.mit.edu/)? Thanks.
- gnachman 11y agoLooks like mosh swallows OSC codes it doesn't know what to do with. I'll let them know.
- hiroprot 11y agoI really like this, but am wondering if something like ZModem over SSH would make the file transfer stuff more convenient...I feel like some things have become more complicated since the BBS days.
- zurn 11y agoStandard ssh protocol supports this already, you can open a file transfer channel on an existing shell connection dynamically.
- deleted 11y ago[deleted]
- gnachman 11y agoYou can do that too, but the download.sh script is much more straightforward: https://github.com/gnachman/iTerm2/blob/master/tests/download.sh https://github.com/gnachman/iTerm2/blob/master/tests/downloa...
- jrcii 11y agoSpeaking of shell integration, I use this Automator app with "Open with" to open Finder files in a new tmux vim window http://pastebin.com/rxyB8c8k http://pastebin.com/rxyB8c8k I use a similar script/Automator app to "Open this directory in iterm" by dragging it into the Finder toolbar http://pastebin.com/1at3CXvP http://pastebin.com/1at3CXvP http://i.imgur.com/QGqQSOJ.png http://i.imgur.com/QGqQSOJ.png
- x0054 11y agoI use iTerm2 a lot in the "visor" (pop up from the top) mode. I have my iTerm2 plist file edited so that it displays no bar icon and pops up even over the full screen apps. It would be really nice to have a feature where instead of a popup alert, the visor window would just slide out, to let me know that it's done. But all in all, sounds like an awesome set of features, will have to try tonight. Thanks! PS: On an unrelated note, if later on you could add native support for pop out window to appear in full screen apps, and maybe do a check, so that if you are in full screen app mode, it pops over with 0 y offset, but if it's in a norma screen, it pops up with offset to accommodate the menu bar, that would be awesome. But no rush :), thanks for all the awesome work!
- deleted 11y ago[deleted]
- neuropie 11y agoThe script downloaded over HTTPS then downloads further scripts over HTTP. Watch out.
- gnachman 11y agoFixed, good catch.
- DavideNL 11y agoDoes this update speed up things as well by any chance? I like iTerm2 a lot, but one day when i coincidentally started using the normal Terminal i noticed how fast it was/how slow iTerm2 was, which is the reason i stopped using iTerm2 and switched to TotalTerminal (a plugin for Terminal.app).
- gnachman 11y agoYes! The incoming bytestream is now parsed into tokens in a separate thread. There are various other performance improvements as well, such as a fastpath for when no double-width characters are present.
- xtacy 11y agoI just love iTerm2, but I feel it's slow and unresponsive at times (Garbage Collection?) compared to Apple's Terminal. I still keep using iTerm2 because of its features. If there is any way I can profile these slowness and submit a bug report to have it fixed, please let me know!
- gnachman 11y agoI assume you're using 2.9.x here. Try turning off prefs>advanced>avoid repainting the screen when the cursor is hidden. Let me know if that makes a difference.
- dublidu 11y agoI'd like to use Automatic Profile Switching to change the profile when I ssh to certain servers, but it doesn't do anything. What am I missing?
- dublidu 11y agoI should add that I use ssh_config. I tried the file download feature but I get an error, it tries to scp from MBP.local and doesn't seem to be aware of my ssh session at all.
- Myrmornis 11y agoThis looks great! I love iterm2 and have used it every day for years. My biggest problem is the configuration -- I just wish it had a plain text configuration file that I could keep under version control. I've experimented with using PListBuddy and a git diff driver to keep the plist under version control but it seems unwieldy and I haven't found that approach useful yet. Also I don't really understand the difference between the main configuration interface (cmd-,) and the "Edit Session..." interface (right click on iterm2 menu). Possibly related, I have a custom command configured in Advanced -> Semantic History but it keeps reverting back to no command and I just don't understand why. I would love not to have to use a graphical interface to configure it, I would like a plain text file instead. I think I'm being dumb and a couple hours consideration would lead me to understand any issues I'm having but the fact remains that after years of use its configuration is something I find really painful.
- chrisshroba 11y agoIs it possible to enable/disable features? Since installing, my prompt has been rather buggy, and there are some features I don't particularly care for, but others I really like. For example, my python virtualenv prompt gets broken into two lines, both with a mark, which causes line lengths to misbehave too sometimes. Alternatively, not to sound like a downer, but is there a way to uninstall shell integration? Thanks!