From d64d0b92d7a9bccfa7edb8db6e3acd1c7e53a7ae Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 9 Mar 2010 22:30:36 +0000 Subject: [PATCH] this way of starting a browser seems more robust (#6) --- Utils.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utils.hs b/Utils.hs index c597fbfb4..b29bc977c 100644 --- a/Utils.hs +++ b/Utils.hs @@ -19,7 +19,7 @@ import System.IO.UTF8 (hPutStrLn) import System.IO (hPutStrLn) #endif import System.Exit -import System.Cmd (system) +import System.Process (readProcessWithExitCode) import System.Info (os) import System.Time (ClockTime,getClockTime) @@ -74,7 +74,7 @@ openBrowserOn :: String -> IO ExitCode openBrowserOn u = trybrowsers browsers u where trybrowsers (b:bs) u = do - e <- system $ printf "%s %s" b u + (e,_,_) <- readProcessWithExitCode b [u] "" case e of ExitSuccess -> return ExitSuccess ExitFailure _ -> trybrowsers bs u