A Vty value represents a handle to the Vty library that the application must create in order to use Vty.
The use of this library typically follows this process:
Initialize Vty with the
mkVtyimplementation for your platform's Vty package (e.g.vty-unix), or, more generically, with mkVtyFromPair. This takes control of (and sets up) the terminal.Use update to display a picture.
Use nextEvent to get the next input event.
Depending on the event, go to 2 or 5.
Shutdown Vty and restore the terminal state with shutdown. At this point the Vty handle cannot be used again.
Operations on Vty handles are not thread-safe.
Constructors
Vtyupdate :: Picture -> IO ()Output the given Picture to the terminal.
nextEvent :: IO EventReturn the next Event or block until one becomes available.
nextEventNonblocking :: IO (Maybe Event)Non-blocking version of nextEvent.
inputIface :: InputThe input interface. See Input.
outputIface :: OutputThe output interface. See Output.
refresh :: IO ()Refresh the display. If other programs output to the terminal and mess up the display then the application might want to force a refresh using this function.
shutdown :: IO ()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. Idempotent.
isShutdown :: IO Bool