Bug 393055 - command line call with --new-tab opens two tabs rather than one in already-running instance
Summary: command line call with --new-tab opens two tabs rather than one in already-ru...
Status: RESOLVED FIXED
Alias: None
Product: Falkon
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-12 17:50 UTC by bozonius
Modified: 2018-04-15 20:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bozonius 2018-04-12 17:50:53 UTC
Assuming there is a running instance of falkon, calling from the command line as follows:

falkon --new-tab http://some/url/or/another

will open two tabs in the already-running instance of falkon (no args to that instance).  The first tab will open on speed dial, the second on the given url passed to the command line call.

I have falkon set to open speed dial by default:  
Preferences->General->Launching->On new tab  is set to "Open speed dial"

I am not aware of any other config mods to falkon, but it is possible.  Proper operation would only open one tab on the given url.

I note that firefox, chrome, and other browsers seem to open new tabs from the command line as expected, without the additional tab.  In fact, I call up firefox from several programs without issue (thunderbird, hexchat, etc) on several systems.

Please also note that https://github.com/QupZilla/qupzilla/issues/2397 is sort of related to this, but it is not quite the same.  In the case of 2397, it sounds like there might not be a running instance of the browser.  A new instance (window) typically pulls up a variety of configurations depending on the browser and/or platform (things like the distro web page, restore session, etc), so I am leery of saying that these are the exact same issue, though ultimately they might be caused by the same code.

This is not precisely a show-stopper, but it is major nuisance.  I like falkon, and would like to continue using it, perhaps deploying it around my various systems as it becomes available and supported.  This defect would impede that.

Specifically, here is my environment:
Artix Linux 
XFWM4 4.12.4
Qt 5.10.1
linux version 4.14.32-1-lts
Comment 1 bozonius 2018-04-15 10:01:09 UTC
Here is something I just discovered; perhaps it may enlighten the issue a bit.

Only qupzilla is available on my other systems.  But I was curious to see if qupzilla has this issue.  I tried the "--new-tab" option and it behaves the same way as with falkon (described here in this bug, opening 2 tabs).   But qupzilla does support "-new-tab" and that option does work as expected.

IOW, qupzilla supports both "-new-tab" and "--new-tab" whereas the former is not supported by falkon.  This may indicate that the code for only one of these was pulled along in the switch to falkon; maybe it would be preferable to pull the other code along and drop the code which did make it in?

At any rate, maybe this will help illuminate the source of the current bug, or a solution to it.
Comment 2 David Rosca 2018-04-15 15:41:43 UTC
There were no changes in command line arguments parsing in Falkon, so it must behave exactly like QupZilla.

One note, "--new-tab" should open just empty new tab (equivalent to Ctrl+T), it does not take URL parameter as you try to do.
So calling "falkon --new-tab URL" will executes these two actions: "falkon --new-tab" + "falkon URL" = open new empty tab and then another tab with URL.
Comment 3 bozonius 2018-04-15 19:47:31 UTC
Sorry, David, I am not sure I understood your post.  The behavior IS as described, and others apparently have seen similar behavior.  Falkon apparently has two similar options for new tab from the command line, differing by one or two leading dashes.  However, the --help for falkon only shows the --new-tab variation, which is the one causing multiple tabs.  The "hidden" option is the one that works correctly, the one with one leading dash, viz: -new-tab.

So this is not truly resolved, really.  Documentation issue, possibly?
Comment 4 bozonius 2018-04-15 20:04:02 UTC
Never mind; I see the problem now.  Falkon's options work the opposite as the other browsers.  I guess I had to look at all of the options to ken that.

Closing again.
Comment 5 David Rosca 2018-04-15 20:17:13 UTC
There is no "-new-tab" variant, this should show unknown switch error, but it does not as it needs to support arbitrary switches that are passed to Chromium.

> Never mind; I see the problem now.  Falkon's options work the opposite as the other browsers.  I guess I had to look at all of the options to ken that.

Yes, "--new-tab" is only for opening *new tab*, not for opening url in new tab. For that, just use "falkon URL".