From f0be1d1a318151b866cf089418da10d90954a217 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Wed, 14 Mar 2007 00:59:31 +0100 Subject: Actually fix the zombie issue. darcs-hash:20070313235931-a5988-71a6be9213d889a01cb645299c5a90d65616c995 --- XMonad.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/XMonad.hs b/XMonad.hs index 61696d9..2b68e2a 100644 --- a/XMonad.hs +++ b/XMonad.hs @@ -24,7 +24,8 @@ import StackSet (StackSet) import Control.Monad.State import System.IO -import System.Posix.Process (createSession, executeFile, forkProcess) +import System.Posix.Process (executeFile, forkProcess, getProcessStatus) +import System.Exit import Graphics.X11.Xlib import Control.Exception @@ -73,8 +74,12 @@ io = liftIO -- | spawn. Launch an external application spawn :: String -> X () -spawn x = do - io $ forkProcess $ do createSession; executeFile "/bin/sh" False ["-c", x] Nothing +spawn x = io $ do + pid <- forkProcess $ do + forkProcess (executeFile "/bin/sh" False ["-c", x] Nothing) + exitWith ExitSuccess + return () + getProcessStatus True False pid return () -- | Run a side effecting action with the current workspace. Like 'when' but -- cgit v1.2.3