<< Back to previous view

[CLJ-896] Make browse-url aware of xdg-open Created: 13/Dec/11  Updated: 24/May/13  Resolved: 24/May/13

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: None
Fix Version/s: Release 1.6

Type: Enhancement Priority: Minor
Reporter: Jasper Lievisse Adriaanse Assignee: Unassigned
Resolution: Completed Votes: 3
Labels: None

All platforms that provide xdg-open (as part of freedesktop.org) benefit from this. Fix was tested on OpenBSD.

Attachments: Text File 0001-teach-browse-url-about-xdg-open.patch     Text File clj-896-browse-url-uses-xdg-open-patch2.txt    
Patch: Code
Approval: Ok
Waiting On: Rich Hickey


clojure.java.browse/browse-url tests to see if it's running on Mac OS to fall back to "/usr/bin/open" in order
to open a URI. On most other systems it'll just falls through to open-url-in-swing instead. The attached patch
tests to see if freedesktop.org's "xdg-open" is present in the users path. This way browse-url will launch the
program associated with the URI, in my case chromium.

Comment by Andy Fingerhut [ 28/Feb/12 6:19 PM ]

CLJ-920, if not identical, at least bears a significant resemblance to this ticket. It would be good to see if the patch for one of them fixes both issues.

Comment by Andy Fingerhut [ 29/Feb/12 1:18 PM ]

clj-896-browse-url-uses-xdg-open-patch2.txt is based more on the patch attached to CLJ-920 by Jeremy Heiler than on the earlier patch attached to this ticket. He and I have signed CAs.

I think this patch improves on both of the previous patches for CLJ-896 and CLJ-920. In particular, Jeremy's worked fine, but it caused a long slowdown in the running of tests when building Clojure. This one does not.

Tested on:

Mac OS X 10.6.8
Windows XP SP3, both in cmd.exe and a Cygwin bash shell
Ubuntu 10.04 LTS

It would be great if someone could test it on a BSD system. The only possible issue I can think of is whether the output of the "which" command is different there than on the Linux system I tested.

If someone wants to make a patch that doesn't use "which", but instead checks the PATH, I'd recommend they also test on Windows in cmd.exe to make sure it works correctly there.

Comment by Stuart Sierra [ 09/Nov/12 9:04 AM ]

Screened. Verified on Mac OS X.

Comment by Jasper Lievisse Adriaanse [ 09/Nov/12 9:41 AM ]

And I've tested it on OpenBSD.

Generated at Wed Jan 17 07:12:49 CST 2018 using JIRA 4.4#649-r158309.