News for hackers. Stuff that matters.
Re:Opening the current Finder directory in iTerm2 by tzs on Wednesday March 14, 2012 @01:51PM (#3704370)
I use Go2Shell, which is free on the Mac App Store: http://itunes.apple.com/us/app/go2shell/id445770608?mt=12

It adds a button to the toolbar to Finder windows. Click that to open a terminal on the directory shown in the window.

There are other similar toolbar add ons available, which I've used and were happy with, such as cdto: http://code.google.com/p/cdto/

I use Go2Shell now because it is on the App Store, so that I don't have to worry about checking for updates.

Re:Opening the current Finder directory in iTerm2 by Sidnicious on Wednesday March 14, 2012 @12:34PM (#3703918)
The terminal app built into OS X (newer versions, at least) lets you drag a folder to its icon to open a new terminal at that path.

It looks like iTerm2 almost does it — if you drag a directory to its icon it tries to execute it (which fails).

EDIT: actually, it looks like iTerm master supports this too: https://github.com/gnachman/iTerm2/blob/194678de81100cb17dad...

…but it doesn’t work for directories with spaces and other special characters. Looks like a bug.

EDIT 2: Pull request sent: https://github.com/gnachman/iTerm2/pull/78

Re:Opening the current Finder directory in iTerm2 by peter_l_downs on Wednesday March 14, 2012 @01:13PM (#3704132)
Very cool. Thanks for sending in the pull request, I'd love to be able to do that instead of using this Finder service (which is a little hack-y).
Re:Opening the current Finder directory in iTerm2 by gnachman on Wednesday March 14, 2012 @04:50PM (#3705288)
Merged. Thanks :)
Re:Opening the current Finder directory in iTerm2 by Sidnicious on Wednesday March 14, 2012 @05:26PM (#3705446)
Awesome!
Re:Opening the current Finder directory in iTerm2 by johncoltrane on Wednesday March 14, 2012 @01:48PM (#3704350)
I use a droplet in the Finder window for that. It's called Open iTerm here.app and I have no idea where I've found it. Google gives quite a bunch of results, though.

Before that, I've used another similar droplet called Open Terminal here.app.

In iTerm I use

    $ open .
to open the current directory in a Finder window.

I also have a little bash function to `cd` into the topmost Finder window:

    cdf () {
      CURRFOLDERPATH=$( /usr/bin/osascript <<"    EOT"
        tell application "Finder"
          try
              set currFolder to (folder of the front window as alias)
          on error
              set currFolder to (path to desktop folder as alias)
          end try
          POSIX path of currFolder
        end tell
        EOT
      )
      echo "cd to \"$CURRFOLDERPATH\""
      cd "$CURRFOLDERPATH"
    }
Re:Opening the current Finder directory in iTerm2 by protomyth on Wednesday March 14, 2012 @12:58PM (#3704047)
I put an icon on the finder window so I just click it and get a terminal open to the directory.

http://maururu.net/2007/enhanced-open-terminal-here-for-leop...

Re:Opening the current Finder directory in iTerm2 by epochwolf on Wednesday March 14, 2012 @02:28PM (#3704595)
If you want do this with Terminal.app instead, there is a setting for this.

Open the keyboard preferences, go to the "Keyboard Shortcuts" tab, click "Services" in the left panel and in the right panel under "Files and Folders", there is an option for "New Terminal at Folder".

Then you can right click on a folder and launch a terminal.

Visual: http://osxdaily.com/2011/12/07/open-a-selected-finder-folder...

Re:Opening the current Finder directory in iTerm2 by mistercow on Wednesday March 14, 2012 @12:01PM (#3703753)
I achieved something similar in bash, in a terminal-agnostic way a while back. I have this script saved at ~/cdf.scpt : https://gist.github.com/2037421

Then my .bash_profile contains the line:

    alias cdf='cd "`osascript ~/cdf.scpt`"'
Now if I type "cdf" in a terminal window, it will automatically cd to the directory of the front-most Finder window.
Re:Opening the current Finder directory in iTerm2 by LiveTheDream on Wednesday March 14, 2012 @12:13PM (#3703815)
I use Alfred (http://www.alfredapp.com/), which gives you a keyboard shortcut (opt-cmd-\) that gives you the ability to open a terminal at the currently selected Finder item.
Re:Opening the current Finder directory in iTerm2 by Steveism on Wednesday March 14, 2012 @02:37PM (#3704665)
This is another good Alfred extension that does basically the same thing but with an AppleScript: https://github.com/pcal/alfred-terminal-here
Re:Opening the current Finder directory in iTerm2 by mrpollo on Wednesday March 14, 2012 @12:52PM (#3704022)
I found this years ago on a forum cant seem to find the link but I'm pretty sure its out there and has been posted here before

https://gist.github.com/2037827

Re:Opening the current Finder directory in iTerm2 by haroldp on Wednesday March 14, 2012 @02:36PM (#3704649)
Wouldn't this be best as a contextual menu extension? Right-click and select open-in-iTerm.

Is anyone still coding those? There was such a huge ecosystem of them forever ago for OS8/9, but I don't see them anymore.

Re:Opening the current Finder directory in iTerm2 by peter_l_downs on Wednesday March 14, 2012 @11:26PM (#3706626)
This is as close as I could get.
Re:Opening the current Finder directory in iTerm2 by bickfordb on Wednesday March 14, 2012 @12:23PM (#3703864)
You can also just write "open ." in an iTerm window
Re:Opening the current Finder directory in iTerm2 by dave1010uk on Wednesday March 14, 2012 @01:32PM (#3704249)
Whilst this is the opposite of what the post is suggesting, it's a useful thing to know.

If you use Nautilus (e.g. Ubuntu), "nautilus ." works. I guess "explorer ." would work in Windows.

Re:Opening the current Finder directory in iTerm2 by Sidnicious on Wednesday March 14, 2012 @12:31PM (#3703906)
Won’t that open the CWD (in that terminal) in a new Finder window?
Re:Opening the current Finder directory in iTerm2 by heliostatic on Wednesday March 14, 2012 @01:38PM (#3704293)
That was my initial thought, but he's describing the reverse: browse to a folder in Finder, then open a terminal with the path set to that directory.
Re:Opening the current Finder directory in iTerm2 by mikey_p on Wednesday March 14, 2012 @01:01PM (#3704065)
That's the reverse of that the author is trying to do, which is open a terminal window, when he has a Finder window open.
Re:Opening the current Finder directory in iTerm2 by LuxuryMode on Wednesday March 14, 2012 @01:27PM (#3704206)
the link to "solarized" just links to iterm2's website...
Re:Opening the current Finder directory in iTerm2 by peter_l_downs on Wednesday March 14, 2012 @11:25PM (#3706621)
Thanks for pointing this out — fixed.