summaryrefslogtreecommitdiffhomepage
path: root/ControlWindow.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-29 15:13:44 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-29 15:13:44 -0400
commit37eb3fc850cb28bcf72d971b4fff99902bbce811 (patch)
tree7271540eaff79baa3a2b5ccbb089a282d28e7f02 /ControlWindow.hs
parenta61df1522ddf8a36839cf1180d3b16e354459e9a (diff)
downloaddebug-me-37eb3fc850cb28bcf72d971b4fff99902bbce811.tar.gz
use developer control window to tell when write access is granted
Diffstat (limited to 'ControlWindow.hs')
-rw-r--r--ControlWindow.hs7
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