Skip to content

Commit dd2a0bb

Browse files
Stephan Sokolowamodm
authored andcommitted
Don't wait for x-www-browser to exit before returning
(Temporary solution to resolve by far the most likely place for this command to block in headless test conditions.)
1 parent d7ae427 commit dd2a0bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,12 @@ fn open_browser_internal(browser: Browser, url: &str) -> Result<ExitStatus> {
283283
.or_else(|_| -> Result<ExitStatus> {
284284
Command::new("kioclient").arg("exec").arg(url).status()
285285
})
286-
.or_else(|_| -> Result<ExitStatus> { Command::new("x-www-browser").arg(url).status() }),
286+
.or_else(|e| -> Result<ExitStatus> {
287+
if let Ok(_child) = Command::new("x-www-browser").arg(url).spawn() {
288+
return Ok(ExitStatusExt::from_raw(0));
289+
}
290+
Err(e)
291+
}),
287292
_ => Err(Error::new(
288293
ErrorKind::NotFound,
289294
"Only the default browser is supported on this platform right now",

0 commit comments

Comments
 (0)