An Exasperating Bug

I like Open Terminal Here and use it frequently. What Open Terminal Here is supposed to do is open a Terminal window with the working directory set to match the finder window from which the script was invoked. It's really handy when one wants to quickly drop down from the GUI to the command line in the middle of some task. Unfortunately, there a bug somewhere1 which makes it occasionally drop the user into a hellish world of madness and pain.

What happens now and then is that Open Terminal Here runs over and over and over, repeating indefinitely, as best I can tell. This means that the system rapidly switches back and forth between the Finder and Terminal, and on each iteration another Terminal window is generated. It's virtually impossible to do anything during this process, since on each switch focus is assigned to the frontmost window of the newly frontmost application. It's also very difficult to break up the cycle: killing Open Terminal Here doesn't work since it is being run again and again, killing the Terminal doesn't help since the next run of Open Terminal Here just starts it again, and relaunching the Finder seems to have no impact either. The only solution I've been able to find is to erase the Open Terminal Here application.

Of course, it's not at all easy to that either: Supposing one manages to get through the blizzard of rapidly switching windows to get into the Applications folder in the Finder, one finds that since Open Terminal Here is constantly running, the FInder doesn't want to delete it. This sounds like a job for rm -rf. Only one thing: it's a bit tricky to execute a shell command in Terminal.app when every tenth of a second the frontmost widow ceases to be frontmost, replaced by another one opened by Open Terminal Here. The solution I've stumbled across is to open X11 and use xterm instead. In order to get enough breathing space to do this, though, it's necessary to force quit Terminal.app, since this delays Open Terminal Here (for all of about half a second) while it has to wait for Terminal.app to launch again. It took me five or six iterations of force quitting and frantically typing a few characters into xterm before I got Open Terminal Here erased, which finally got things under control.

That was, unfortunately, after ten or fifteen minutes of panic and frustration trying to figure out what was going on and how to make it stop.


  1. I'm not by any means sure that the bug is in Open Terminal Here itself; it may well be in the Finder, somewhere in the implementation of Applescript, or in the interaction of the three. 

No Comments

Comment on this post