Fork to shell script and terminate original process with Haskell

Posted by Neth on Stack Overflow See other posts from Stack Overflow or by Neth
Published on 2012-11-06T22:33:15Z Indexed on 2012/11/06 23:00 UTC
Read the original article Hit count: 192

Filed under:
|
|

I am currently writing a Haskell program that does some initialization work and then calls ncmpcpp. What I am trying to do is start ncmpcpp and terminate the Haskell program, so that only ncmpcpp is left (optionally, the program can keep running in the background, as long as it's unintrusive)

However, even though I am able to start ncmpcpp, I cannot interact with it. I see its output, but input appears to be impossible.

What I am currently doing is:

import System.Process (createProcess, proc)
...
spawnCurses :: [String] -> IO ()
spawnCurses params = do 
  _ <- createProcess (proc "ncmpcpp" params)
  return ()

What am I doing wrong/What should I do differently?

© Stack Overflow or respective owner

Related posts about haskell

Related posts about process