Merge pull request #161 from seagreen/is-shutdown

Add isShutdown field to Vty.
This commit is contained in:
Jonathan Daugherty 2018-10-15 13:36:24 -07:00 committed by GitHub
commit 3a8dc67865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}