mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 08:49:40 +03:00
Add isShutdown field to Vty.
This commit is contained in:
parent
8207c1497f
commit
57342ae29a
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user