<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div>Hi Everyone,</div><div><br></div><div>I am strugling to get the following code to work correctly and I'm hoping</div><div>someone will be able to shed some light as to why the code is behaving</div><div>as it does:</div><div><br></div><div> {-| runs the supplied command and args as a SHELL command -}<br> runShell :: String -> IO (String, ExitCode)<br> runShell shellCmd = do<br> (_, Just hOut, Just hErr, hProcess) <- createProcess (shell shellCmd) { std_out = CreatePipe, std_err = CreatePipe }<br> exitCode <- waitForProcess hProcess<br> outTxt <- hGetContents hOut<br> errTxt <- hGetContents hErr<br> return $ (outTxt
++ errTxt, exitCode)</div><div><br></div><div><br></div><div>If I try to su the runShell function with the following command, it simply</div><div>blocks forever:</div><div><br></div><div><span class="tab"> git --no-pager blame <your git file here></span></div><div><br><span class="tab"></span></div><div><span class="tab">but if I do:</span></div><div><br><span class="tab"></span></div><div><span class="tab"> git status</span></div><div><br><span class="tab"></span></div><div><span class="tab">The runShell function works as expected. Can someone shed some light on why the 'git blame' command blocks? Interrestingly enough, if I remove the waitForProcess action, the 'git blame' command starts working as expected, but I no longer have my blocking behaviour, waiting for the command to finish and return the ExitCode.</span></div><div><br><span class="tab"></span></div><div><span
class="tab">Regards</span></div><div><br><span class="tab"></span></div><div><span class="tab">Rouan<br></span></div></div></body></html>