I'm pretty sure xdg-open ends up being a thin wrapper that delegates
to your desktop environment's open program (gnome-open, kde-open,
xce-open, etc)
so probably that is where the difference lies.

--Aaron

On Nov 10, 2012, at 12:52 AM, Michael Gardner <gardne...@gmail.com> wrote:

> I can't duplicate your results on my Debian wheezy box (Clojure 1.4, openjdk 
> 1.6.0_24, xdg-open 1.1.0 rc1); the call to (sh "xdg-open" …) returns 
> immediately. The only possibilities I can think of are that your version of 
> xdg-open blocks when run from a non-interactive shell, or that your version 
> of Java somehow handles subprocesses differently.
>
> The first possibility should be easy to test. And you should be able to test 
> the second by writing your own shell script that forks and then exits (at 
> least, I assume that's what xdg-open is doing).
>
> On Nov 9, 2012, at 19:26 , Andy Fingerhut <andy.finger...@gmail.com> wrote:
>
>> This issue may be specific to Linux, or even to a particular version of 
>> Linux that I am using (Ubuntu 11.10 32-bit desktop), although I doubt it is. 
>>  If others try this out, I'd be curious to know what your results are, 
>> especially if you know why it is happening, and how it can be fixed.
>>
>> First, some behavior from a bash window on Ubuntu 11.10:
>>
>> % echo hi
>> hi
>> % xdg-open http://www.google.com
>> %
>>
>> After pressing return for the xdg-open command above, my browser opens a tab 
>> to Google's home page.  Back in the shell window, the next prompt appears 
>> immediately, even though the browser is still running and open to that page. 
>>  That is what I expect to happen.
>>
>> However, if I do the following commands inside of a Clojure REPL (tested 
>> Clojure 1.4 and 1.5-beta1 so far):
>>
>> % rlwrap java -cp ~/lein/clojure-1.4.0/lib/clojure-1.4.0.jar clojure.main
>> Clojure 1.4.0
>> user=> (require '[clojure.java.shell :as sh])
>> nil
>> user=> (sh/sh "echo" "hi")
>> {:exit 0, :out "hi\n", :err ""}
>> user=> (sh/sh "xdg-open" "http://www.google.com";)
>>
>> The invocation of echo returns immediately, printing the result and the next 
>> REPL prompt.  But when I invoke xdg-open, while the browser window appears 
>> and goes to the Google home page, back in the bash window I see no return 
>> value and no new REPL prompt.
>>
>> If I quit the browser, then back in the bash window I finally see the return 
>> value and a REPL prompt, as shown below:
>>
>> {:exit 0, :out "", :err ""}
>> user=>
>>
>>
>> What I'm wishing would happen is for the return value and REPL prompt to 
>> appear very soon after pressing return when invoking xdg-open with 
>> clojure.java.shell/sh.
>>
>> I added some debug print messages to a local copy of clojure.java.shell/sh, 
>> and it is stopping when waiting for the evaluation of either @out or @err in 
>> the final line of the function.
>>
>> If I do the same commands above on Mac OS X, with "open" instead of 
>> "xdg-open", it all works as I expect.
>>
>> Any clues?
>>
>> Thanks,
>> Andy
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with your 
>> first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to