From 75a2a5432c284161411779a02a6f0b02f7328970 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Apr 2017 16:31:30 -0400 Subject: misc minor cleanups --- debug-me.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'debug-me.hs') diff --git a/debug-me.hs b/debug-me.hs index c219360..44f3a38 100644 --- a/debug-me.hs +++ b/debug-me.hs @@ -18,16 +18,16 @@ import Data.Monoid main :: IO () main = do - exitstatus <- go + exitstatus <- go ">>> debug-me started" putStrLn "" putStrLn ">>> debug-me is exiting..." exitWith exitstatus where - go = runWithPty "bash" [] $ \(p, ph) -> do + go startmsg = runWithPty "bash" [] $ \(p, ph) -> do ichan <- newTChanIO ochan <- newTChanIO dthread <- async (developer ichan ochan) - uthread <- async (user p ichan ochan) + uthread <- async (user startmsg p ichan ochan) exitstatus <- waitForProcess ph cancel dthread cancel uthread @@ -107,9 +107,9 @@ sendTtyOutput ochan devstate = go -- missed one somehow. Ignore it? _ -> return mempty -user :: Pty -> TChan (Activity Entered) -> TChan (Activity Seen) -> IO () -user p ichan ochan = do - let startact = StartActivity (Seen ">>> debug-me started\r\n") dummySignature +user :: B.ByteString -> Pty -> TChan (Activity Entered) -> TChan (Activity Seen) -> IO () +user startmsg p ichan ochan = do + let startact = StartActivity (Seen (startmsg <> "\r\n")) dummySignature atomically $ writeTChan ochan startact backlog <- newTVarIO $ Backlog ((hash startact, startact) :| []) _ <- sendPtyOutput p ochan backlog -- cgit v1.2.3