Skip to content

Instantly share code, notes, and snippets.

@simonmichael
Created July 7, 2017 14:16
Show Gist options
  • Save simonmichael/929f7434a4db2216382d72c8a1345ead to your computer and use it in GitHub Desktop.
Save simonmichael/929f7434a4db2216382d72c8a1345ead to your computer and use it in GitHub Desktop.
running an interactive pager
runPagerForTopic :: FilePath -> Topic -> IO ()
runPagerForTopic exe t = do
(Just inp, _, _, ph) <- createProcess (proc exe []){
std_in=CreatePipe
}
hPutStrLn inp (lookupDocTxt t)
_ <- waitForProcess ph
return ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment