You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to have a desktop icon, both on Windows and Linux, that can open a dropped outline in Leo. But this outline will open in a new Leo window, which is slow and usually not what is wanted.
It would be a useful improvement if Leo were able to open such dropped files in the running Leo session if there is one. Many other existing programs can do this.
The text was updated successfully, but these errors were encountered:
I see several ways of tackling this enhancement. I haven't sorted through them to pick an approach yet. Here are some possibilities:
A file is dropped on a Leo icon and the OS tries to start Leo with the file on the command line. During startup, Leo checks to see if it is already running, and if so, has the existing session open the file. Otherwise it starts as usual.
The icon actually is connected to a client program. When a file is dropped on it, the client pings Leo's monitor port to see if Leo is running. If not, it uses OS calls to open it with the file on the command line. If it is, it send the file's path to Leo's monitor port. Leo responds by opening the file.
Much like 2, but Leo starts a stand-alone server that the client talks to. Leo has its own client that polls the server, and if the server has received a file-to-open request, it sends that file to Leo. If no server exists, the icon's client opens Leo with the file on the command line.
Much like 2, but the client program uses OS process information to try to identify if the Leo process with that ID still exists.
With method 1, there is the matter of how Leo can check to see if it's already running. It cannot be by checking an environmental variable because the attempt to open Leo might come from a console or other source outside of Leo's current session environment. It could be a lock file, but lock files will get stranded if Leo crashes without closing them.
Maybe the lock file could contain Leo's OS process identifier, and the OS could say if that process already exists. Of course, this would need to work cross-platform and I haven't looked into it, but it sounds feasible. The system would also have to know which instance of Leo to use if more than one were running.
I already have working code for most of alternative 3 (developed for another purpose). It wouldn't be hard, I think, but I'm not sure how to deal with the situation where there are several Leo instances running and only one started the server. How would the server know which instance to send the open-file request to? Possibly, the first one that asks. But I don't think that's the lowest-surprise solution.
It is possible to have a desktop icon, both on Windows and Linux, that can open a dropped outline in Leo. But this outline will open in a new Leo window, which is slow and usually not what is wanted.
It would be a useful improvement if Leo were able to open such dropped files in the running Leo session if there is one. Many other existing programs can do this.
The text was updated successfully, but these errors were encountered: