Proposal: use /usr/bin/open as an alternative for run-mailcap and others.

Charles Plessy plessy at debian.org
Fri Oct 9 20:27:17 BST 2020


Thanks you Simon, Jérémie and everybody for your feedback.

> On Thu, 08 Oct 2020 at 05:54:27 +0900, Charles Plessy wrote:
> > /bin/open has been kindly freed a couple years ago (#732796) and I would
> > like to propose to repurpose it as a standard command for opening files,
> > like on Mac OS and NextStep before it.

Le Wed, Oct 07, 2020 at 11:17:34PM +0100, Simon McVittie a écrit :
> 
> Is this intentionally a filename, and not a URI reference like the
> argument to xdg-open(1), the `gio open` subcommand in gio(1), and macOS
> open(1)? In particular, if we're using this name by analogy with the
> command in macOS, it doesn't seem great to be using a different invocation
> pattern.

I intentionally refrained from including URIs in my proposal, but I am
willing to consider it.

On my side, I never used open or xdg-open with a URL, so when I first
saw `xdg-open {file | URL}` in its manual page, I wondered how important
it was for the end user.  Then, I looked at the manual page of `open` on
macOS, and saw that its first two lines only mention files and
directories.  Thanks for the heads-up, now I know it also opens URLs.

For browsing an URL, I always call `firefox` directly.  This is more a
habit than a conscious decision, and also I would not pretend to
represent the typical user.  May I ask you for extra information on how
important is it to support URLs, and if anything beyond file:/, http://
and https:// would need to be supported ?  Also, can you give me a
pointer to an explanation of what file:/ URLs are useful for ?  I read
RFC 8089, but still did not get the point.

The reason I ask is that `run-mailcap` does not support URLs
at the moment.  It would be possible to have emulate other tools by
passing HTTP urls to the default browser.  Still, I wonder
if that is what a new user would expect.  For instance, since `eog
http://example.com/image.png` will open the image, shouldn't an "open"
program ask to the server what the media type of the URL is, and pass it
to the default program able to handle it, instead of just visualising in
the browser ?  But if the answer is "yes", I do not know how long it
would take me to implement it...

Le Wed, Oct 07, 2020 at 07:15:42PM -0400, Jeremy Bicha a écrit :
> 
> You should be aware that Ubuntu implemented this idea 2 years ago.
> (I'm sure Ubuntu developers would love for this to be implemented by
> other distros or further upstream.)
> 
> https://launchpad.net/bugs/1624022

I was not aware of the `browse` command implemented following the
Launchpad bug above; thank you for the heads-up.  I just read the
discussion, and I see that `open` was also considered, but unfortunately
it was not free at that time.  I think that `open` is a much better word
for the task.  Also, it is not clear to me if `browse` intends to be an
alias to `xdg-open` only or something broader.

I the case of `open`, if there is an interest for the alternatives
system, I intend to give a low priority to the one pointing to
run-mailcap, so that on defauult Desktop systems, `open` would really
emulate what happens when the user double-clicks a file.

Have a nice day,

-- 
Charles Plessy
Akano, Uruma, Okinawa, Japan



More information about the Pkg-freedesktop-maintainers mailing list