diff options
Diffstat (limited to 'ControlWindow.hs')
-rw-r--r-- | ControlWindow.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ControlWindow.hs b/ControlWindow.hs index 02cffd6..edd493e 100644 --- a/ControlWindow.hs +++ b/ControlWindow.hs @@ -29,6 +29,10 @@ import Prelude winDesc :: String winDesc = "debug-me session control and chat window" +displayInControlWindow :: TMChan ControlInput -> String -> IO () +displayInControlWindow ichan msg = atomically $ + writeTMChan ichan (ControlWindowMessage msg) + controlWindow :: ControlOpts -> IO () controlWindow _ = do putStrLn $ "** " ++ winDesc @@ -92,6 +96,9 @@ displayInput ochan ichan promptchan responsechan = loop where loop = go =<< atomically (readTMChan ichan) go Nothing = return () + go (Just (ControlWindowMessage m)) = do + putStrLn m + loop go (Just (ControlInputAction (SessionKey k))) = do askToAllow ochan promptchan responsechan k loop |