Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow opening URLs without explicit command line switch #187

Closed
GSI opened this issue Jan 26, 2016 · 12 comments
Closed

Allow opening URLs without explicit command line switch #187

GSI opened this issue Jan 26, 2016 · 12 comments
Labels

Comments

@GSI
Copy link
Contributor

GSI commented Jan 26, 2016

The issue:

BROWSER='uzbl-browser -u'
$BROWSER http://uzbl.org
# => zsh: command not found: uzbl-browser -u

To avoid this, simply running uzbl-browser http://uzbl.org (without -u/--uri) should be possible.

@keis
Copy link
Member

keis commented Jan 26, 2016

Looks like this was intentionally removed by 520fbf and upgrading.md tells the same story.

For `uzbl-core`, a URI must now use the `--uri` flag; the first non-flag
argument is no longer interpreted as a URI (this is to avoid confusion of what
should be loaded with `uzbl-core --uri page1 page2`).

So I'm a bit hesitant to simply restore this. But maybe removing -u is a better option. WDYT @mathstuf ?

@keis keis added the core label Jan 26, 2016
@mathstuf
Copy link
Member

Without specifying what should happen with uzbl-core page1 page2, I'd rather keep it under -u.

@GSI
Copy link
Contributor Author

GSI commented Jan 26, 2016 via email

@keis
Copy link
Member

keis commented Jan 26, 2016

I guess we could recommmend people to configure BROWSER to xdg-open and then set uzbl as the default browser.

Also just discovered we need some extra bits for the desktop file for that to work

@GSI
Copy link
Contributor Author

GSI commented Jan 26, 2016

I don't quite get the issue with just ditching -u / --uri altogether (?)

The expected behaviour of $BROWSER $uri is to open the given URI.
(Of the ones I tested, uzbl is the only one not doing so.)

Requiring an additional flag causes known and future issues.

@keis wrote:

I guess we could recommmend people to configure BROWSER to xdg-open and then set uzbl as the default browser.

Bad idea :) (xdg-open is not a BROWSER)

My xdg-open replacement, for example, executes $BROWSER for any URL provided. So that would create a loop unless I (and every other linopen-user) "cripples" their config by explicitly naming $their_currently_preferred_browser.

@mathstuf
Copy link
Member

So it seems other browsers open all URLs given on the command line. uzbl-core only supports one. uzbl-tabbed and uzbl-browser could take multiples on the command line, but I don't think uzbl-core itself should.

@keis
Copy link
Member

keis commented Jan 26, 2016

@GSI ok, fair point

I wouldn't worry too much about multiple uris as uzbl is still specifically a single page browser. Exiting with non-zero when we get more should be a reasonable option for core. And I would suggest uzbl-browser should do the same to keep things simple for now and not have to grok the arguments for uzbl-core.

@keis
Copy link
Member

keis commented Jan 26, 2016

Checked just now and uzbl-tabbed already works this way

@keis
Copy link
Member

keis commented Jan 27, 2016

So does droppign -u and going with only the first argument as url and error if there is more sound like a good aproach for core?

@mathstuf
Copy link
Member

I still think uzbl-core should have a flag and uzbl-browser act more like a browser there.

Keep -u and, if it isn't given, use the first argument and warn if adding argument parsing to uzbl-browser is onerous?

@keis
Copy link
Member

keis commented Jan 27, 2016

Is there really any benefit to -u over a positional argument in core?

It's not very complex to add some getopt magic to uzbl-browser as it would not have to know about any specifics of the arguments except -u. But there still code in two placing fiddling with the opts which I think we should avoid if possible

@mathstuf
Copy link
Member

I guess not. We should output that we're ignoring arguments to stderr though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants