<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>&nbsp;&nbsp; {-| runs the supplied command and args as a SHELL command -}<br>&nbsp;&nbsp; runShell :: String -&gt; IO (String, ExitCode)<br>&nbsp;&nbsp; runShell shellCmd = do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (_, Just hOut, Just hErr, hProcess) &lt;- createProcess (shell shellCmd) { std_out = CreatePipe, std_err = CreatePipe }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exitCode &lt;- waitForProcess hProcess<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outTxt &lt;- hGetContents hOut<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; errTxt &lt;- hGetContents hErr<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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">&nbsp;&nbsp;&nbsp; git --no-pager blame &lt;your git file here&gt;</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">&nbsp;&nbsp;&nbsp; git status</span></div><div><br><span class="tab"></span></div><div><span class="tab">The runShell function works as expected.&nbsp; Can someone shed some light on why the 'git blame' command blocks?&nbsp; 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>