From 6689a535857c39d4d1b463104e66054ce57e0081 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Thu, 29 Dec 2022 12:05:08 -0500 Subject: [PATCH] FIX signal handlers for forked processes --- lib/XMonad/Internal/Shell.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/XMonad/Internal/Shell.hs b/lib/XMonad/Internal/Shell.hs index c30d1fe..cf74715 100644 --- a/lib/XMonad/Internal/Shell.hs +++ b/lib/XMonad/Internal/Shell.hs @@ -42,12 +42,12 @@ withDefaultSignalHandlers = addGroupSession :: P.ProcessConfig x y z -> P.ProcessConfig x y z addGroupSession = P.setCreateGroup True . P.setNewSession True --- readProcess :: P.ProcessConfig a b c -> IO (ExitCode, B.ByteString, B.ByteString) --- readProcess = withDefaultSignalHandlers . P.readProcess - runProcess :: P.ProcessConfig a b c -> IO ExitCode runProcess = withDefaultSignalHandlers . P.runProcess +startProcess :: P.ProcessConfig a b c -> IO (P.Process a b c) +startProcess = withDefaultSignalHandlers . P.startProcess + shell :: T.Text -> P.ProcessConfig () () () shell = addGroupSession . P.shell . T.unpack @@ -55,14 +55,14 @@ proc :: FilePath -> [T.Text] -> P.ProcessConfig () () () proc cmd args = addGroupSession $ P.proc cmd (T.unpack <$> args) spawn :: MonadIO m => T.Text -> m () -spawn = liftIO . void . P.startProcess . shell +spawn = liftIO . void . startProcess . shell spawnAt :: MonadIO m => FilePath -> T.Text -> m () -spawnAt fp = liftIO . void . P.startProcess . P.setWorkingDir fp . shell +spawnAt fp = liftIO . void . startProcess . P.setWorkingDir fp . shell spawnStdin :: MonadIO m => B.ByteString -> T.Text -> m () spawnStdin i = - liftIO . void . P.startProcess . P.setStdin (P.byteStringInput i) . shell + liftIO . void . startProcess . P.setStdin (P.byteStringInput i) . shell spawnCmd :: MonadIO m => FilePath -> [T.Text] -> m () spawnCmd cmd = spawn . fmtCmd cmd