Opening the current Finder directory in iTerm2
peterdowns.com
peterdowns.com
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.
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
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"
}http://maururu.net/2007/enhanced-open-terminal-here-for-leop...
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...
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.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.
If you use Nautilus (e.g. Ubuntu), "nautilus ." works. I guess "explorer ." would work in Windows.