tab("new") command line - changing existing tab in running instance

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
xyplorerköln
Posts: 179
Joined: 01 Jan 2016 18:59

tab("new") command line - changing existing tab in running instance

Post by xyplorerköln »

Hi there -

I just tried launching a fresh install of XYplorer using the command-line parameters:
/script="::tab('new');"

If XYplorer is closed when the command is issued, XYplorer does what I expect: XYplorer runs, shows all tabs open at last close, and opens a new tab. So, for example: if when I last closed XYplorer, I had these tabs open in a pane:

C:\folder1
D:\folder2
G:\folder3 (focused)

I now have these tabs open:

C:\folder1
D:\folder2
G:\folder3
G:\folder3 (focused)

That's good. But then, once XYplorer is open, if I issue the command-line command with /script="::tab('new');" again, I get this:

C:\folder1
D:\folder2
G:\folder3
This PC
This PC (focused)

I don't mind that XYplorer opens the new tab to This PC, and of course I could change that. But I was surprised that XYplorer also navigates the previously-focused tab (in this case, it was on G:\folder3) to This PC also.

When I open XYplorer via command line without using /script="::tab('new');", even if I issue the command repeatedly while XYplorer is running, it doesn't change any of the tabs to This PC. So to me, it doesn't make sense that using /script="::tab('new');" does change an existing tab (in addition to the new tab) to This PC.

Is this intended, or a bug? What am I missing?

jupe
Posts: 3478
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: tab("new") command line - changing existing tab in running instance

Post by jupe »

you need /flg=2 on the command line as well

xyplorerköln
Posts: 179
Joined: 01 Jan 2016 18:59

Re: tab("new") command line - changing existing tab in running instance

Post by xyplorerköln »

jupe wrote:you need /flg=2 on the command line as well
That did it! Excellent, and thank you!

I saw that the command line switch documentation says:
/flg=2: You can feed a script into an existing instance of XYplorer without changing the location or tabs of
that instance. Simply pass the switch /flg=2 in the command line, for example:
XYplorer.exe /script="::msg 'Hi!';" /flg=2
May I ask: In the use case I described, why is the default behavior to change the location of an existing tab in the existing instance? I might be wrong, but I would think the typical expectation would be (a) if I'm simply asking to open a new tab, (b) XYplorer should respond as if I've clicked the + button to create a new tab. Personally I wouldn't expect I'd have to set flg=2 to keep an existing tab from changing; rather, I'd expect that I'd have to set additional command line arguments in order to cause behavior like changing existing tabs when creating a new tab. What's the underlying idea on this?

jupe
Posts: 3478
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: tab("new") command line - changing existing tab in running instance

Post by jupe »

Your "May I Ask" is a question for the dev so I can't answer that, but another option you could look at is

Configuration | General | Startup & Exit | Open command line start path in new tab

if you always want them to load in a new tab, that way you can just use without the /script= tab etc.

XYplorer.exe "c:\location\wanted\in\new\tab"

xyplorerköln
Posts: 179
Joined: 01 Jan 2016 18:59

Re: tab("new") command line - changing existing tab in running instance

Post by xyplorerköln »

xyplorerköln wrote:May I ask: In the use case I described, why is the default behavior to change the location of an existing tab in the existing instance? I might be wrong, but I would think the typical expectation would be (a) if I'm simply asking to open a new tab, (b) XYplorer should respond as if I've clicked the + button to create a new tab. Personally I wouldn't expect I'd have to set flg=2 to keep an existing tab from changing; rather, I'd expect that I'd have to set additional command line arguments in order to cause behavior like changing existing tabs when creating a new tab. What's the underlying idea on this?
Don, any thoughts on this? I suspect you have a logical reason that counters my inquiry.

jupe
Posts: 3478
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: tab("new") command line - changing existing tab in running instance

Post by jupe »

Sorry to interject, but there is a new command line switch /feed= so you can use that instead of /script... /flg=2 if you want, it was born after these discussions.

Release notes:
viewtopic.php?f=1&t=4&start=4095#p156599

Post Reply