Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Synchronize Path Finder's main and terminal windows Apps
Path Finder is a wonderful Finder replacement/add-on, with great features like integrated text editing, easy metadata tweaking, and quick navigation. One cool feature is the Terminal drawer -- a little terminal that slides out below your browsing window. It starts out in the same directory as the browsing window, but doesn't stay in sync as you either move in the window, or cd in the terminal.

In the spirit of this hint, here are two new bash functions, pff and pft. pff changes the Terminal working directory to the current Path Finder folder; pft changes the frontmost window to the current Path Finder Terminal directory. Using these together, you can quickly hop back and forth between the browsing window and the terminal.

To use, copy and paste this code, and paste it into your .bashrc.

[robg adds: These scripts worked for me in testing; just type pff to set the Terminal to the currently active Path Finder directory, and pft to move the Path Finder directory to the active Terminal directory. One minor caveat -- to make a directory active in the Path Finder window, you need to select something inside the directory. So if you're trying to get the Terminal window to go to /dir1/dir2/dir3, make sure you've clicked on an item within dir3 in the Path Finder window. Otherwise, the pff command will leave you in dir2. And if you haven't checked out Path Finder, it's well worth the time to do so; it's an amazingly versatile tool, and a (long ago) Pick of the Week.]
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[10,412 views]  

Synchronize Path Finder's main and terminal windows | 5 comments | Create New Account
Click here to return to the 'Synchronize Path Finder's main and terminal windows' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Make the synchronization automatic
Authored by: mithras on Apr 14, '05 10:19:12AM

Adding to my own hint here :)

To make this synchronization automatic -- so that every cd in the terminal drawer is reflected in the Path Finder window, and every change in the window is reflected in the terminal -- you can add the below to a .bashrc:

Caveats:
  1. The PROMPT_COMMAND, which synchronizes the terminal to the window, is slow. I don't mind because I use the terminal drawer sparingly, but if it bothers you, you can drop it.
  2. This works better in list and icon views than column, because column view steals the focus from the terminal every time you cd in terminal.
function mycd()
{
	if [ ! -z "$LAUNCHING_APP" ]; then
		if [ "$LAUNCHING_APP" = "Path Finder" ]; then
			pft
			export DONT_RUN_PFF="true"
		fi
	fi
}

alias cd="mycd" 

if [ ! -z "$LAUNCHING_APP" ]; then
if [ "$LAUNCHING_APP" = "Path Finder" ]; then
export PROMPT_COMMAND="if [ -z $DONT_RUN_PFF ]; then pff; fi; unset DONT_RUN_PFF"
fi
fi

---
--
Listen To My iTunes Library (6500+ songs, iTunes 4 required)

[ Reply to This | # ]

Synchronize Path Finder's main and terminal windows
Authored by: neilio on Apr 14, '05 12:26:43PM

Very cool terminal-fu!

We have some basic file browser - terminal synchronization working in the forth-coming Path Finder 4, but nothing close to this (yet). I've forwarded this on to the developer to see if we can make this functionality work in a faster, more integrated way (without requiring any local file editing).

Thanks for posting this, mithras!

---
Slumming at http://www.beatnikpad.com/



[ Reply to This | # ]
Synchronize Path Finder's main and terminal windows
Authored by: JaxMyers on Apr 14, '05 05:00:48PM

I've got a few questions...

First, do I have to be using PathFinder for this to work, or will it work int he Apple terminal app?

Also, when I launch terminal, why does it not run my .bashrc script? It only seems to run .bashrc if I open a new bash once I'm in terminal.



[ Reply to This | # ]
Synchronize Path Finder's main and terminal windows
Authored by: mithras on Apr 15, '05 04:59:01PM

1. Yes, this is specific to Path Finder. It's really only useful with a tied-together terminal and file window, I think. Try it!

2. Perhaps you need to add a .profile file that contains

. "$HOME/.bashrc"
I wouldn't think that'd be necessary, but these things are befuddling.

---
--
Listen To My iTunes Library (6500+ songs, iTunes 4 required)

[ Reply to This | # ]

Synchronize Path Finder's main and terminal windows
Authored by: dgharrison on Jul 11, '05 10:47:08PM

I get the following error:
[code]
2005-07-12 12:41:06.612 osascript[723] CFLog (21): Cannot find executable for CFBundle 0x3546c0 </Users/dan/Library/ScriptingAdditions/Contents> (not loaded)
[/code]

Does anyone know how to fix this?



[ Reply to This | # ]