Problem with XYplorer's single-instance setting
-
- Posts: 16
- Joined: 11 Feb 2018 18:36
Problem with XYplorer's single-instance setting
I have enabled the single-instance setting in XYplorer. Despite this, I get two instances (I seem unable to create a third one) when launching XYplorer from 2 different command windows.
This is on Windows 10 64-bit with all the latest updates (as of writing), running XYplorer 18.70.0100 in "portable mode."
This is on Windows 10 64-bit with all the latest updates (as of writing), running XYplorer 18.70.0100 in "portable mode."
Re: Problem with XYplorer's single-instance setting
You mean you disabledI have enabled the single-instance setting in XYplorer
Configuration | General | Startup & Exit | Allow multiple instances?
How were the command windows invoked, what exactly did you use to startup XY?when launching XYplorer from 2 different command windows
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 16
- Joined: 11 Feb 2018 18:36
Re: Problem with XYplorer's single-instance setting
I mean disabled - yes.
The command is set up like this:
Invoking it twice from the samd cmd.exe window starts a single instance. Invoking it from two different cmd.exe windows starts two instances. Invoking it from three different cmd.exe window starts TWO instances (it reactivates the last one started).
The command is set up like this:
Code: Select all
doskey e.=xyplorer
Re: Problem with XYplorer's single-instance setting
If you are interested in a temporary workaround
might fix it.
Code: Select all
XYPlorer.exe /flg=2
-
- Posts: 16
- Joined: 11 Feb 2018 18:36
Re: Problem with XYplorer's single-instance setting
Adding /flg=2 doesn't fix it. :-(
Re: Problem with XYplorer's single-instance setting
Hmm...it did for me, have you restarted XYplorer since you changed the multiple instances setting? I needed to for it to take effect.
-
- Posts: 16
- Joined: 11 Feb 2018 18:36
Re: Problem with XYplorer's single-instance setting
Ok, so you could reproduce the issue as I described it?
You are correct, it fixes the issue with two cmd.exe windows. However, now I do the following:
1. Start a cmd.exe window
2. Run XY from it
3. Start Sublime Text (or anything else)
4. Run XY from that program
The issue appears just as I described it above. I can create two instances, but no more. I applied the /flg=2 switch both from cmd.exe and Sublime Text.
(I just restarted my computer again before trying this, to make sure)
You are correct, it fixes the issue with two cmd.exe windows. However, now I do the following:
1. Start a cmd.exe window
2. Run XY from it
3. Start Sublime Text (or anything else)
4. Run XY from that program
The issue appears just as I described it above. I can create two instances, but no more. I applied the /flg=2 switch both from cmd.exe and Sublime Text.
(I just restarted my computer again before trying this, to make sure)
Re: Problem with XYplorer's single-instance setting
I couldn't/can't reproduce it as you described, what I initially did try was flicking the setting and not restarting and that allowed me to create more than one instance, but when I tried /flg=2 it stopped that from happening, which is why I suggested it as a temporary workaround.
But once I restarted XY I can't get more than one instance to open, I have tried multiple command prompt windows, launching it directly from my text editor, launching a command prompt from the text editor and then trying to launch it again, I tried admin command prompt etc.
The developer will look into trying to reproduce it on his system when he gets a chance too, but so far I haven't seen it, I am on Win10 x64 latest ver too.
But once I restarted XY I can't get more than one instance to open, I have tried multiple command prompt windows, launching it directly from my text editor, launching a command prompt from the text editor and then trying to launch it again, I tried admin command prompt etc.
The developer will look into trying to reproduce it on his system when he gets a chance too, but so far I haven't seen it, I am on Win10 x64 latest ver too.
On the initial launch from cmd you won't need it. Not that it should make a difference, but if you launch it from a normal shortcut instead of cmd do you see the same behavior?bossebengt wrote:I applied the /flg=2 switch both from cmd.exe and Sublime Text.
-
- Posts: 16
- Joined: 11 Feb 2018 18:36
Re: Problem with XYplorer's single-instance setting
So here's what I did now:
1. Start Sublime Text
2. Start XY from Sublime Text
3. Double-click xyplorer.exe
Doing this, I end up with two instances. Trying to launch another one from either one just reactivates the same instance that was previously launched by the respective program.
1. Start Sublime Text
2. Start XY from Sublime Text
3. Double-click xyplorer.exe
Doing this, I end up with two instances. Trying to launch another one from either one just reactivates the same instance that was previously launched by the respective program.
-
- Posts: 16
- Joined: 11 Feb 2018 18:36
Re: Problem with XYplorer's single-instance setting
Seems I can't fix this. You should look into using mutexes for single instance handling - current method doesn't seem to be working well enough. I'll be buying a lifetime license if this is fixed, but the single-instance fix is crucial for me as I have a tiled window layout with everything I need to see up on my monitors during my work days, so the single-instance feature is actually the main reason for switching away from explorer.exe
-
- Posts: 16
- Joined: 11 Feb 2018 18:36
Re: Problem with XYplorer's single-instance setting
In case it helps in debugging the issue:
I just found out that if I open Help -> About (or any other dialog in XY) in the first instance, no second instance will be started. As long as the dialog is shown in the first instance, it will be activated (as it should).
I just found out that if I open Help -> About (or any other dialog in XY) in the first instance, no second instance will be started. As long as the dialog is shown in the first instance, it will be activated (as it should).
Re: Problem with XYplorer's single-instance setting
Use this as a XY launcher in the meantime... It checks if an XY window already exists and only if this is NOT the case, itbut the single-instance fix is crucial for me
will launch one. It reads the full command line (Windows API), so you should
be able to use the full palette of what XY supports as command line parameters...
Call it e.g. with:
Code: Select all
"<path to XY_Single instance launcher.exe>" "<path to XYplorer.exe>" <parameters>
Suggested: Quote <path to XYplorer.exe>
Code: Select all
"<path to XY_Single instance launcher.exe>" "<path to XYplorer.exe>" /script="::text 'hello';"
Code: Select all
"<path to XY_Single instance launcher.exe>" <path to XYplorer.exe> /script="::text 'hello';"
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 16
- Joined: 11 Feb 2018 18:36
Re: Problem with XYplorer's single-instance setting
So, what's really interesting with the launcher:
1. Calling it with xyplorer_launcher (I renamed it to get rid of spaces) results in it exiting and starting itself over and over (the process gets a new PID over and over so I'm assuming it's exiting and launching itself in an eternal loop)
2. Adding .exe (i.e., calling the launcher with xyplorer_launcher.exe instead of just xyplorer_launcher) fixes this.
3. Calling xyplorer_launcher.exe XYPlorer.exe "c:\some\path" from cmd.exe works fine
4. Calling the exact same command from Sublime Text results in REGULAR Windows File Explorer opening, browsing the path to where XYPlorer.exe is located
What do I do?
EDIT: I should add:
a. There are no spaces in any paths
b. Quotes or not makes no difference
c. Providing the FULL path to XYPlorer.exe or just "XYPlorer.exe" (since it's in the PATH var + same dir as the launcher) makes no difference
EDIT2: More weirdness:
It only opens regular File Explorer if no previous instance of XYPlorer is opened. If it is, the command does absolutely nothing. What I want is for it to activate XYPlorer.exe and browse to the new dir (like it normally does, except I get 2 instances)
1. Calling it with xyplorer_launcher (I renamed it to get rid of spaces) results in it exiting and starting itself over and over (the process gets a new PID over and over so I'm assuming it's exiting and launching itself in an eternal loop)
2. Adding .exe (i.e., calling the launcher with xyplorer_launcher.exe instead of just xyplorer_launcher) fixes this.
3. Calling xyplorer_launcher.exe XYPlorer.exe "c:\some\path" from cmd.exe works fine
4. Calling the exact same command from Sublime Text results in REGULAR Windows File Explorer opening, browsing the path to where XYPlorer.exe is located
What do I do?
EDIT: I should add:
a. There are no spaces in any paths
b. Quotes or not makes no difference
c. Providing the FULL path to XYPlorer.exe or just "XYPlorer.exe" (since it's in the PATH var + same dir as the launcher) makes no difference
EDIT2: More weirdness:
It only opens regular File Explorer if no previous instance of XYPlorer is opened. If it is, the command does absolutely nothing. What I want is for it to activate XYPlorer.exe and browse to the new dir (like it normally does, except I get 2 instances)
-
- Posts: 16
- Joined: 11 Feb 2018 18:36
Re: Problem with XYplorer's single-instance setting
Ok, more info:
1. I just bought XYplorer
2. The two instances have different environment variables (though the relevant ones like %userprofile% etc seem to be the same). Can this cause the issue?
3. I'm now using Emacs instead of Sublime Text and I see the same issue
1. I just bought XYplorer
2. The two instances have different environment variables (though the relevant ones like %userprofile% etc seem to be the same). Can this cause the issue?
3. I'm now using Emacs instead of Sublime Text and I see the same issue
Re: Problem with XYplorer's single-instance setting
I fixed 01 and 04 from the previous post but I can't just pass the parameters to the launcher like you requested with this:
problem as before.
Ofc I can rewrite your path in the parameter list into a script command for XY to execute (which would work with /flg=2).
E.g. you invoked it with:
then it would look like this after rewriting it:
This would do exactly what you are requesting.
So... Are you ALWAYS AND ONLY passing a path to XYplorer, when you invoke it?
Otherwise it would be a parsing nightmare if you'd use other options as well...
Why not? If you pass a path to XYplorer it won't get accepted if /flg=2 is used. And using /flg=2 is a necessity, otherwise you would have the sameIt only opens regular File Explorer if no previous instance of XYPlorer is opened. If it is, the command does absolutely nothing. What I want is for it to activate XYPlorer.exe and browse to the new dir (like it normally does, except I get 2 instances)
problem as before.
Ofc I can rewrite your path in the parameter list into a script command for XY to execute (which would work with /flg=2).
E.g. you invoked it with:
Code: Select all
"<path to XYplorer>" "<the path to go to>"
Code: Select all
"<path to XYplorer>" /script="::goto '<the path to go to>';" /flg=2
So... Are you ALWAYS AND ONLY passing a path to XYplorer, when you invoke it?
Otherwise it would be a parsing nightmare if you'd use other options as well...
Probably yes. Why do your applications get different environments from the OS?2. The two instances have different environment variables (though the relevant ones like %userprofile% etc seem to be the same). Can this cause the issue?
One of my scripts helped you out? Please donate via Paypal