diff --git a/lib/XMonad/Internal/Shell.hs b/lib/XMonad/Internal/Shell.hs index b8fa339..390d553 100644 --- a/lib/XMonad/Internal/Shell.hs +++ b/lib/XMonad/Internal/Shell.hs @@ -101,10 +101,7 @@ spawnPipeRW -> m Handle spawnPipeRW x = do (r, h) <- liftIO mkPipe - void $ withRunInIO $ \runIO -> do - X.xfork $ runIO $ do - void $ liftIO $ dupTo r stdInput - liftIO $ executeFile "/bin/sh" False ["-c", T.unpack x] Nothing + child r liftIO $ closeFd r return h where @@ -116,6 +113,10 @@ spawnPipeRW x = do hSetEncoding h utf8 hSetBuffering h LineBuffering return (r, h) + child r = void $ withRunInIO $ \runIO -> do + X.xfork $ runIO $ do + void $ liftIO $ dupTo r stdInput + liftIO $ executeFile "/bin/sh" False ["-c", T.unpack x] Nothing -- | Run 'XMonad.Core.spawn' with a command and arguments spawnCmd :: MonadIO m => FilePath -> [T.Text] -> m ()