hbang / TermHere

Finder extension for opening a terminal from the current directory
https://hbang.com.au/termhere
Apache License 2.0
110 stars 11 forks source link

Opens 2 windows on toolbar click #20

Open luckman212 opened 6 years ago

luckman212 commented 6 years ago

Like the app, but running into a few bugs on 10.13.6:

1) Clicking the toolbar button opens TWO iTerm/Terminal windows. I believe this is possibly because of bug 2:

2) Seems that there are often 2 instances of the TermHere Finder Extension running when I checked via pgrep -lf TermHere. Killing them temporarily fixes the issue, but some minutes later there are 2 running again...

3) I don't like the "instant launch" upon mouse-down. I'd prefer if the button behaved like all other standard macOS buttons—i.e. take action when the mouse is released (in case we change our mind mid-click). Also, the icon doesn't make sense anymore if there's no drop-down—the arrow part should be removed.

luckman212 commented 6 years ago

Ah I just saw on Known Issues (https://hbang.ws/status/) that TermHere is listed as not-yet-10.13-compatible. Hopefully you're working on an update?

kirb commented 6 years ago

1 has been fixed for the upcoming release.

2 is expected and unrelated; just how the Finder framework works. My guess is there's one for Finder, plus a shared one for open/save panels in apps. You'll find the same with any other Finder extension, e.g. Google Drive, Dropbox, etc.

3, this was my attempt to do the best I could within what the Finder framework supports. Intially I used a dropdown with the one "new terminal here" item in it, but people didn't like that, so my best workaround was to invoke the action as soon as Finder asks for my menu. The upcoming release adds extra functions ("open in editor"), so it acts as a dropdown menu again.

If you know how to use Xcode, you can try building from the latest code on master. Uninstall your downloaded copy first as Finder and the Services systems don't react well to multiple of the same app being installed.

luckman212 commented 6 years ago

Cool thanks for that info. Too bad about no.3 - but I do see now that the Finder doesn't allow this. I've seen other solutions where a separate app (script etc) is dragged to the toolbar, and this method allows the button to function as a "regular" button. So maybe a little helper app that talks to the Finder extension could work.

If a new build is still far off I will try to build my own in Xcode. Thanks again

hitzhangjie commented 5 years ago

Do we have a plan to solve this problem?