Open-in-Terminal from desktop and some other bugs ?

BTT version: 4.639
MacOS: Ventura


First

BTT put a new line at the end of visible_window_list which is not easily discoverable from GUI. I only discovered it running javascript. And if you don't include the new line it won't match.


2nd

I was using finder context menu open-in-terminal from the article here.

Finder-Context-menu-with-BTT

It works very well. Except when all finder window closes and then if you right click on the desktop and click Open in Terminal, it doesn't work. I am using Warp as terminal.

However New File (from the same article) works irrespective of any finder window visible or not.

Of-course I can use script and run as open -a Warp {BTTFinderContextMenuTargetPath}, that will work, but why it doesn't work normally ?

Any idea ?

Ah, the visible_window_list can't/shouldn't be used for equality checks. The order of the windows is also not guaranteed and various system windows can popup there.
Instead it's intended to be used with the "contains" check to check for specific windows.

Probably the desktop would need to be identified specifically because it behaves quite different from a scripting perspective. I'll check whether I can support this in the standard "open active / selected folder" action. When using BTTFinderContextMenuTargetPath it works without scripting Finder, thus is much more reliable.