diff options
Diffstat (limited to 'debug-me.hs')
-rw-r--r-- | debug-me.hs | 12 |
1 files changed, 6 insertions, 6 deletions
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 |