Add isShutdown field to Vty.

This commit is contained in:
Ian Grant Jeffries 2018-10-15 16:25:40 -04:00
parent 8207c1497f
commit 57342ae29a

View File

@ -94,8 +94,9 @@ data Vty = Vty
-- | Clean up after vty. A call to this function is necessary to
-- cleanly restore the terminal state before application exit. The
-- above methods will throw an exception if executed after this is
-- executed.
-- executed. Idempotent.
, shutdown :: IO ()
, isShutdown :: IO Bool
}
-- | Create a Vty handle. At most one handle should be created at a time
@ -125,6 +126,8 @@ intMkVty input out = do
releaseDisplay out
releaseTerminal out
let shutdownStatus = atomically $ readTVar shutdownVar
lastPicRef <- newIORef Nothing
lastUpdateRef <- newIORef Nothing
@ -175,4 +178,5 @@ intMkVty input out = do
, outputIface = out
, refresh = innerRefresh
, shutdown = shutdownIo
, isShutdown = shutdownStatus
}