Skip to content

Commit 027d8ff

Browse files
committed
Revert "CLJ-2493: Prevent browse-url from hanging when using xdg-open (updated)"
This reverts commit c33a5ab.
1 parent da0b957 commit 027d8ff

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

src/clj/clojure/java/browse.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@
7171
script (if (= :uninitialized script)
7272
(reset! *open-url-script* (open-url-script-val))
7373
script)]
74-
(or (when script (sh/launch script (str url)) true)
74+
(or (when script (sh/sh script (str url)) true)
7575
(open-url-in-browser url)
7676
(open-url-in-swing url))))

src/clj/clojure/java/shell.clj

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,6 @@ collecting its stdout"}
127127
exit-code (.waitFor proc)]
128128
{:exit exit-code :out @out :err @err}))))
129129

130-
(defn launch
131-
"Same as sh except the I/O channels of the sub-process are ignored.
132-
133-
Use when you want the sub-process to take an action, but do not want to wait
134-
for the I/O channels to close. Example: Launching a browser with xdg-open.
135-
"
136-
{:added "1.11"}
137-
[& args]
138-
(let [[cmd opts] (parse-args args)
139-
proc (.exec (Runtime/getRuntime)
140-
^"[Ljava.lang.String;" (into-array cmd)
141-
(as-env-strings (:env opts))
142-
(as-file (:dir opts)))]
143-
{:exit (.waitFor proc)}))
144-
145130
(comment
146131

147132
(println (sh "ls" "-l"))
@@ -154,9 +139,4 @@ collecting its stdout"}
154139
(println (sh "cat" "myimage.png" :out-enc :bytes)) ; reads binary file into bytes[]
155140
(println (sh "cmd" "/c dir 1>&2"))
156141

157-
(println (launch "touch" "my-test-file"))
158-
(println (sh "ls" "-l" "my-test-file"))
159-
(println (launch "rm" "my-test-file"))
160-
(println (sh "ls" "-l" "my-test-file"))
161-
162142
)

0 commit comments

Comments
 (0)