-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Portable terminal interaction library
--   
--   Please see the README on Github at
--   <a>https://github.com/lpeterse/haskell-terminal#readme</a>
@package terminal
@version 0.2.0.0

module System.Terminal

-- | Run the given handler with the locally connected terminal
--   (<a>stdin</a> / <a>stdout</a>).
--   
--   <pre>
--   import System.Terminal
--   
--   main :: IO ()
--   main = withTerminal $ <a>runTerminalT</a> do
--       <a>putTextLn</a> "Hello there, please press a button!"
--       <a>flush</a>
--       ev &lt;- <tt>waitEvent</tt>
--       <a>putStringLn</a> $ "Event was " ++ show ev
--       <a>flush</a>
--   </pre>
withTerminal :: (MonadIO m, MonadMask m) => (LocalTerminal -> m a) -> m a

-- | Run a <a>TerminalT</a> application on the given terminal.
runTerminalT :: (MonadIO m, MonadMask m, Terminal t) => TerminalT t m a -> t -> m a

-- | This monad transformer represents terminal applications.
--   
--   It implements all classes in this module and should serve as a good
--   foundation for most use cases.
--   
--   Note that it is not necessary nor recommended to have this type in
--   every signature. Keep your application abstract and mention
--   <a>TerminalT</a> only once at the top level.
--   
--   Example:
--   
--   <pre>
--   main :: IO ()
--   main = <tt>withTerminal</tt> (<a>runTerminalT</a> myApplication)
--   
--   myApplication :: (<a>MonadPrinter</a> m) =&gt; m ()
--   myApplication = do
--       <a>putTextLn</a> "Hello world!"
--       <a>flush</a>
--   </pre>
data TerminalT t (m :: Type -> Type) a

-- | This class describes an environment that Unicode text can be printed
--   to. This might either be file or a terminal.
--   
--   <ul>
--   <li>Instances shall implement the concept of lines and line
--   width.</li>
--   <li>Instances shall implement the concept of a carriage that can be
--   set to the beginning of the next line.</li>
--   <li>It is assumed that the carriage automatically moves to the
--   beginning of the next line if the end of the current line is
--   reached.</li>
--   <li>Instances shall be Unicode aware or must at least be able to print
--   a replacement character.</li>
--   <li>Implementations must be aware of infinite lazy <a>String</a>s and
--   long <a>Text</a>s. <a>String</a>s should be printed character wise as
--   evaluating them might trigger exceptions at any point. Long text
--   should be printed chunk wise in order to stay interruptible.</li>
--   <li>Implementations must not use an unbounded output buffer. Print
--   operations shall block and be interruptible when the output buffer is
--   full.</li>
--   <li>Instances shall not pass control characters in text to the printer
--   (not even line break). Control characters shall be replaced with �.
--   Text formatting shall be done with the designated classes extending
--   <a>MonadMarkupPrinter</a>. Allowing control sequences would cause a
--   dependency on certain terminal types, but also pose an underrated
--   security risk as modern terminals are highly programmable and should
--   not be fed with untrusted input.</li>
--   </ul>
class Monad m => MonadPrinter (m :: Type -> Type)

-- | Move the carriage to the beginning of the next line.
putLn :: MonadPrinter m => m ()

-- | Print a single character.
putChar :: MonadPrinter m => Char -> m ()

-- | Print a <a>String</a>.
putString :: MonadPrinter m => String -> m ()

-- | Print a <a>String</a> and an additional newline.
putStringLn :: MonadPrinter m => String -> m ()

-- | Print a <a>Text</a>.
putText :: MonadPrinter m => Text -> m ()

-- | Print a <a>Text</a> and an additional newline.
putTextLn :: MonadPrinter m => Text -> m ()

-- | Flush the output buffer and make the all previous output actually
--   visible after a reasonably short amount of time.
--   
--   <ul>
--   <li>The operation may return before the buffer has actually been
--   flushed.</li>
--   </ul>
flush :: MonadPrinter m => m ()

-- | Get the current line width.
--   
--   <ul>
--   <li>The operation may return the last known line width and may not be
--   completely precise when I/O is asynchronous.</li>
--   <li>This operations shall not block too long and rather be called more
--   often in order to adapt to changes in line width.</li>
--   </ul>
getLineWidth :: MonadPrinter m => m Int

-- | This class introduces abstract constructors for text markup.
class MonadPrinter m => MonadMarkupPrinter (m :: Type -> Type) where {
    
    -- | This associated type represents all possible attributes that are
    --   available in the current environment.
    --   
    --   When writing polymorphic code against these monadic interfaces the
    --   concrete instantiation of this type is usually unknown and class
    --   instances are generally advised to not expose value constructors for
    --   this type.
    --   
    --   Instead, subclasses like <a>MonadFormattingPrinter</a> and
    --   <a>MonadColorPrinter</a> offer abstract value constructors like
    --   <a>bold</a>, <a>underlined</a>, <a>inverted</a> which are then given
    --   meaning by the concrete class instance.
    data Attribute (m :: Type -> Type);
}
setAttribute :: MonadMarkupPrinter m => Attribute m -> m ()

-- | Reset an attribute so that it does no longer affect subsequent output.
--   
--   <ul>
--   <li>Binary attributes like <a>bold</a> or <a>underlined</a> shall just
--   be reset to their opposite.</li>
--   <li>For non-binary attributes like colors all of their possible values
--   shall be treated as equal, so that</li>
--   </ul>
--   
--   <pre>
--   <a>setAttribute</a> (<a>foreground</a> $ <a>bright</a> <a>blue</a>) &gt;&gt; <a>resetAttribute</a> (<a>foreground</a> <a>red</a>)
--   
--   </pre>
--   
--   results in the foreground color attribute reset afterwards whereas
--   after
--   
--   <pre>
--   <a>setAttribute</a> (<a>foreground</a> $ <a>bright</a> <a>blue</a>) &gt;&gt; <a>resetAttribute</a> (<a>background</a> <a>red</a>)
--   
--   </pre>
--   
--   the foreground color is still set as <a>bright</a> <a>blue</a>.
resetAttribute :: MonadMarkupPrinter m => Attribute m -> m ()

-- | Reset all attributes to their default.
resetAttributes :: MonadMarkupPrinter m => m ()

-- | Shall determine wheter two attribute values would override each other
--   or can be applied independently.
--   
--   <ul>
--   <li>Shall obey the laws of equivalence.</li>
--   </ul>
resetsAttribute :: MonadMarkupPrinter m => Attribute m -> Attribute m -> Bool
class MonadMarkupPrinter m => MonadFormattingPrinter (m :: Type -> Type)

-- | This attribute makes text appear <b>bold</b>.
bold :: MonadFormattingPrinter m => Attribute m

-- | This attribute makes text appear <i>italic</i>.
italic :: MonadFormattingPrinter m => Attribute m

-- | This attribute makes text appear underlined.
underlined :: MonadFormattingPrinter m => Attribute m

-- | This attribute swaps foreground and background (color).
--   
--   <ul>
--   <li>This operation is idempotent: Applying the attribute a second time
--   won't swap it back. Use <a>resetAttribute</a> instead.</li>
--   </ul>
inverted :: MonadFormattingPrinter m => Attribute m

-- | This class offers abstract value constructors for foreground and
--   background coloring.
class MonadMarkupPrinter m => MonadColorPrinter (m :: Type -> Type) where {
    data Color (m :: Type -> Type);
}
black :: MonadColorPrinter m => Color m
red :: MonadColorPrinter m => Color m
green :: MonadColorPrinter m => Color m
yellow :: MonadColorPrinter m => Color m
blue :: MonadColorPrinter m => Color m
magenta :: MonadColorPrinter m => Color m
cyan :: MonadColorPrinter m => Color m
white :: MonadColorPrinter m => Color m
bright :: MonadColorPrinter m => Color m -> Color m

-- | This attribute sets the <b>foreground</b> color (the text color).
foreground :: MonadColorPrinter m => Color m -> Attribute m

-- | This attribute sets the <b>background</b> color.
background :: MonadColorPrinter m => Color m -> Attribute m

-- | Print an annotated <a>Doc</a>.
--   
--   Example:
--   
--   <pre>
--   import System.Terminal
--   import Data.Text.Prettyprint.Doc
--   
--   printer :: (<tt>MonadFormatingPrinter</tt> m, <a>MonadColorPrinter</a> m) =&gt; m ()
--   printer = <a>putDoc</a> $ <a>annotate</a> (foreground $ <a>bright</a> <a>blue</a>) "This is blue!" &lt;&gt; <a>line</a>
--                   &lt;&gt; <a>annotate</a> <a>bold</a> ("Just bold!" &lt;&gt; otherDoc &lt;&gt; "..just bold again")
--   
--   otherDoc :: (<a>MonadColorPrinter</a> m, <a>Attribute</a> m ~ ann) =&gt; <a>Doc</a> ann
--   otherDoc = <a>annotate</a> (<a>background</a> <a>red</a>) " BOLD ON RED BACKGROUND "
--   </pre>
--   
--   Note the necessary unification of <a>Attribute</a> <tt>m</tt> and
--   <tt>ann</tt> in the definition of <tt>otherDoc</tt>!
putDoc :: MonadMarkupPrinter m => Doc (Attribute m) -> m ()

-- | Like <a>putDoc</a> but adds an additional newline.
putDocLn :: MonadMarkupPrinter m => Doc (Attribute m) -> m ()

-- | Prints types instantiating the <a>Pretty</a> class.
putPretty :: (MonadMarkupPrinter m, Pretty a) => a -> m ()

-- | Prints types instantiating the <a>Pretty</a> class and adds an
--   additional newline.
putPrettyLn :: (MonadMarkupPrinter m, Pretty a) => a -> m ()

-- | Prints <a>SimpleDocStream</a>s (rather internal and not for the
--   average user).
putSimpleDocStream :: MonadMarkupPrinter m => SimpleDocStream (Attribute m) -> m ()
class MonadPrinter m => MonadScreen (m :: Type -> Type)

-- | Get the dimensions of the visible window.
getWindowSize :: MonadScreen m => m Size

-- | Move the cursor <tt>n</tt> lines up. Do not change column.
moveCursorUp :: MonadScreen m => Int -> m ()

-- | Move the cursor <tt>n</tt> lines down. Do not change column.
moveCursorDown :: MonadScreen m => Int -> m ()

-- | Move the cursor <tt>n</tt> columns to the right. Do not change line.
moveCursorForward :: MonadScreen m => Int -> m ()

-- | Move the cursor <tt>n</tt> columns to the left. Do not change line.
moveCursorBackward :: MonadScreen m => Int -> m ()

-- | Get the current cursor position as reported by the terminal.
--   
--   <ul>
--   <li><tt>Position 0 0</tt> is the upper left of the window.</li>
--   <li>The cursor is always within window bounds.</li>
--   <li>This operation causes a round-trip to the terminal and shall be
--   used sparely (e.g. on window size change).</li>
--   </ul>
getCursorPosition :: MonadScreen m => m Position

-- | Set the cursor position.
--   
--   <ul>
--   <li><tt>Position 0 0</tt> is the upper left of the window.</li>
--   <li>The resulting cursor position is undefined when it is outside the
--   window bounds.</li>
--   </ul>
setCursorPosition :: MonadScreen m => Position -> m ()

-- | Set the cursor row.
--   
--   <ul>
--   <li><tt>0</tt> is the topmost row.</li>
--   </ul>
setCursorRow :: MonadScreen m => Int -> m ()

-- | Set the cursor column.
--   
--   <ul>
--   <li><tt>0</tt> is the leftmost column.</li>
--   </ul>
setCursorColumn :: MonadScreen m => Int -> m ()

-- | Save cursor position and attributes.
saveCursor :: MonadScreen m => m ()

-- | Restore cursor position and attributes.
--   
--   <ul>
--   <li>Restores the cursor as previously saved by <a>saveCursor</a>.</li>
--   <li>The cursor position is strictly relative to the visible window and
--   does not take eventual scrolling into account. The advantage of this
--   operation is that it does not require transmission of coordinates and
--   attributes to the terminal and is therefor slightly more efficient
--   than all other alternatives.</li>
--   <li>Only use this when auto-wrap is disabled, alternate screen buffer
--   is enabled or you can otherwise guarantee that the window does not
--   scroll between <a>saveCursor</a> and <a>restoreCursor</a>!</li>
--   </ul>
restoreCursor :: MonadScreen m => m ()

-- | Insert whitespace at the cursor position and shift existing characters
--   to the right.
insertChars :: MonadScreen m => Int -> m ()

-- | Delete characters and shift existing characters from the right.
deleteChars :: MonadScreen m => Int -> m ()

-- | Replace characters with whitespace.
eraseChars :: MonadScreen m => Int -> m ()

-- | Insert lines and shift existing lines downwards.
insertLines :: MonadScreen m => Int -> m ()

-- | Delete lines and shift up existing lines from below.
deleteLines :: MonadScreen m => Int -> m ()

-- | Clears characters in the current line.
eraseInLine :: MonadScreen m => EraseMode -> m ()

-- | Clears lines above/below the current line.
eraseInDisplay :: MonadScreen m => EraseMode -> m ()

-- | Show the cursor.
showCursor :: MonadScreen m => m ()

-- | Hide the cursor.
hideCursor :: MonadScreen m => m ()

-- | Whether or not to automatically wrap on line ends.
setAutoWrap :: MonadScreen m => Bool -> m ()

-- | Whether or not to use the alternate screen buffer.
--   
--   <ul>
--   <li>The main screen buffer content is preserved and restored when
--   leaving the alternate screen screen buffer.</li>
--   <li>The dimensions of the alternate screen buffer are exactly those of
--   the screen.</li>
--   </ul>
setAlternateScreenBuffer :: MonadScreen m => Bool -> m ()
data Size
Size :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> Size
[height] :: Size -> {-# UNPACK #-} !Int
[width] :: Size -> {-# UNPACK #-} !Int
data Position
Position :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> Position
[row] :: Position -> {-# UNPACK #-} !Int
[col] :: Position -> {-# UNPACK #-} !Int
data EraseMode

-- | Erase left of/above current cursor position.
EraseBackward :: EraseMode

-- | Erase right of/below current cursor position.
EraseForward :: EraseMode

-- | Erase whole line/screen.
EraseAll :: EraseMode

-- | This is a convenience class combining all other terminal related
--   classes.
class (MonadInput m, MonadFormattingPrinter m, MonadColorPrinter m, MonadScreen m) => MonadTerminal (m :: Type -> Type)

-- | This monad describes an environment that maintains a stream of
--   <a>Event</a>s and offers out-of-band signaling for interrupts.
--   
--   <ul>
--   <li>An interrupt shall occur if the user either presses CTRL+C or any
--   other mechanism the environment designates for that purpose.</li>
--   <li>Implementations shall maintain an interrupt flag that is set when
--   an interrupt occurs. Computations in this monad shall check and reset
--   this flag regularly. If the execution environment finds this flag
--   still set when trying to signal another interrupt, it shall throw
--   <a>UserInterrupt</a> to the seemingly unresponsive computation.</li>
--   </ul>
class MonadIO m => MonadInput (m :: Type -> Type)

-- | Wait for the next interrupt or next event transformed by a given
--   mapper.
--   
--   <ul>
--   <li>The first mapper parameter is a transaction that succeeds as soon
--   as an interrupt occurs. Executing this transaction resets the
--   interrupt flag. When a second interrupt occurs before the interrupt
--   flag has been reset, the current thread shall receive an
--   <a>UserInterrupt</a>.</li>
--   <li>The second mapper parameter is a transaction that succeeds as as
--   soon as the next event arrives and removes that event from the stream
--   of events. It shall be executed at most once within a single
--   transaction or the transaction would block until the requested number
--   of events is available.</li>
--   <li>The mapper may also be used in order to additionally wait on
--   external events (like an <a>Async</a> to complete).</li>
--   </ul>
awaitWith :: MonadInput m => (STM Interrupt -> STM Event -> STM a) -> m a

-- | Wait for the next event.
--   
--   <ul>
--   <li>Returns as soon as an interrupt or a regular event occurs.</li>
--   <li>This operation resets the interrupt flag, signaling responsiveness
--   to the execution environment.</li>
--   </ul>
awaitEvent :: MonadInput m => m (Either Interrupt Event)

-- | Check whether an interrupt is pending.
--   
--   <ul>
--   <li>This operation resets the interrupt flag, signaling responsiveness
--   to the execution environment.</li>
--   </ul>
checkInterrupt :: MonadInput m => m Bool

-- | Events emitted by the terminal.
--   
--   <ul>
--   <li>Event decoding might be ambique. In case of ambiqueness all
--   possible meaning shall be emitted. The user is advised to only match
--   on events expected in a certain context and ignore all others.</li>
--   <li>Key events are highly ambique: I.e. when the user presses
--   <tt>space</tt> it might either be meant as a regular text element
--   (like <tt>a</tt>,<tt>b</tt>,<tt>c</tt>) or the focus is on the key
--   itself (like in "Press space to continue...").</li>
--   <li>The story is even more complicated: Depending on terminal type and
--   <tt>termios</tt> settings, certain control codes have special meaning
--   or not (<tt>Ctrl+C</tt> sometimes means interrupt, but not if the
--   environment supports delivering it as a signal). Don't wait for
--   <tt>Ctrl+C</tt> when you mean <a>Interrupt</a>! Example: The tab key
--   will likely emit <tt>KeyEvent (CharKey <tt>I</tt>) ctrlKey</tt> and
--   <tt>KeyEvent TabKey mempty</tt> in most settings.</li>
--   </ul>
data Event
KeyEvent :: Key -> Modifiers -> Event
MouseEvent :: MouseEvent -> Event
WindowEvent :: WindowEvent -> Event
DeviceEvent :: DeviceEvent -> Event
OtherEvent :: String -> Event

-- | Interrupt is a special type of event that needs to be treated with
--   priority. It is therefor not included in the regular event stream.
data Interrupt
Interrupt :: Interrupt

-- | Events triggered by key press.
data Key
CharKey :: Char -> Key
TabKey :: Key
SpaceKey :: Key
BackspaceKey :: Key
EnterKey :: Key
InsertKey :: Key
DeleteKey :: Key
HomeKey :: Key
BeginKey :: Key
EndKey :: Key
PageUpKey :: Key
PageDownKey :: Key
EscapeKey :: Key
PrintKey :: Key
PauseKey :: Key
ArrowKey :: Direction -> Key
FunctionKey :: Int -> Key

-- | Modifier keys.
data Modifiers
shiftKey :: Modifiers
ctrlKey :: Modifiers
altKey :: Modifiers
metaKey :: Modifiers
data Direction
Upwards :: Direction
Downwards :: Direction
Leftwards :: Direction
Rightwards :: Direction

-- | Events triggered by mouse action.
--   
--   <ul>
--   <li>Mouse event reporting must be activated before (TODO).</li>
--   </ul>
data MouseEvent
MouseMoved :: Position -> MouseEvent
MouseButtonPressed :: Position -> MouseButton -> MouseEvent
MouseButtonReleased :: Position -> MouseButton -> MouseEvent
MouseButtonClicked :: Position -> MouseButton -> MouseEvent
MouseWheeled :: Position -> Direction -> MouseEvent
data MouseButton
LeftMouseButton :: MouseButton
RightMouseButton :: MouseButton
OtherMouseButton :: MouseButton
data WindowEvent
WindowLostFocus :: WindowEvent
WindowGainedFocus :: WindowEvent
WindowSizeChanged :: WindowEvent
data DeviceEvent
DeviceAttributesReport :: String -> DeviceEvent
CursorPositionReport :: Position -> DeviceEvent

module System.Terminal.Internal

-- | Types that represent terminals need to implement this class in order
--   to be driven by this library.
--   
--   This library ships with two instances:
--   
--   <ul>
--   <li><a>LocalTerminal</a> represents the local terminal wired to the
--   process.</li>
--   <li><a>VirtualTerminal</a> is a minimal in-process terminal emulator
--   designed to be used for unit-testing terminal applications.</li>
--   </ul>
class Terminal t

-- | The terminal identification string usually extracted from the
--   environment variable <tt>TERM</tt>. Should contain values like
--   <tt>xterm</tt> or <tt>rxvt-unicode</tt>.
termType :: Terminal t => t -> ByteString

-- | A stream of input events. The transaction will succeed as soon as the
--   next input event becomes available.
--   
--   Note: Trying to read more than one event within the same transaction
--   might be successfull, but might also lead to undesired behaviour as
--   the transaction will block until all of its preconditions are
--   fulfilled.
termEvent :: Terminal t => t -> STM Event

-- | This transaction succeeds as soon as an interrupt occurs. Executing
--   the transaction shall reset an interrupt flag maintained by a
--   supervising background thread.
--   
--   It is mandatory to regularly check this transaction in order to signal
--   responsiveness to the background thread. The execution environment is
--   otherwise advised to throw an <a>UserInterrupt</a> exception as soon
--   as a second interrupt arrives and it sees a previous one unhandled.
termInterrupt :: Terminal t => t -> STM Interrupt

-- | This operation shall send a command to the terminal. It shall block
--   when the buffer exeeded its capacity and unblock as soon as space
--   becomes available again.
--   
--   Note: All implementations must limit the size of the output buffer or
--   the application is at risk of running out of memory when writing much
--   faster than the terminal can read.
termCommand :: Terminal t => t -> Command -> IO ()

-- | This operations flushes the output buffer. Whether it blocks or not
--   until the buffer has actually been flushed shall be undefined (there
--   might be other buffers involved that cannot be force-flushed so it is
--   probably better to not give any guarantees here).
termFlush :: Terminal t => t -> IO ()

-- | This operation shall return the latest known window size without
--   blocking.
termGetWindowSize :: Terminal t => t -> IO Size

-- | This operation shall return the current cursor position. It may block
--   as depending on implementation it usually requires an in-band
--   roundtrip to the terminal. Use it wisely.
termGetCursorPosition :: Terminal t => t -> IO Position

-- | The commands every terminal needs to understand.
--   
--   This shall only be extended when something is missing that all
--   terminals understand. Otherwise portability will be lost.
data Command
PutLn :: Command
PutText :: Text -> Command
SetAttribute :: Attribute -> Command
ResetAttribute :: Attribute -> Command
ResetAttributes :: Command
MoveCursorUp :: Int -> Command
MoveCursorDown :: Int -> Command
MoveCursorForward :: Int -> Command
MoveCursorBackward :: Int -> Command
ShowCursor :: Command
HideCursor :: Command
SaveCursor :: Command
RestoreCursor :: Command
GetCursorPosition :: Command
SetCursorPosition :: Position -> Command
SetCursorRow :: Int -> Command
SetCursorColumn :: Int -> Command
InsertChars :: Int -> Command
DeleteChars :: Int -> Command
EraseChars :: Int -> Command
InsertLines :: Int -> Command
DeleteLines :: Int -> Command
EraseInLine :: EraseMode -> Command
EraseInDisplay :: EraseMode -> Command
SetAutoWrap :: Bool -> Command
SetAlternateScreenBuffer :: Bool -> Command

-- | ANSI text attributes.
data Attribute
Bold :: Attribute
Italic :: Attribute
Underlined :: Attribute
Inverted :: Attribute
Foreground :: Color -> Attribute
Background :: Color -> Attribute

-- | ANSI colors.
data Color
Black :: Color
Red :: Color
Green :: Color
Yellow :: Color
Blue :: Color
Magenta :: Color
Cyan :: Color
White :: Color
BrightBlack :: Color
BrightRed :: Color
BrightGreen :: Color
BrightYellow :: Color
BrightBlue :: Color
BrightMagenta :: Color
BrightCyan :: Color
BrightWhite :: Color

-- | The type <a>Decoder</a> is a finite state transducer.
--   
--   Intermediate state can be passed as closure. See below for an example.
newtype Decoder
Decoder :: (Modifiers -> Char -> Either Decoder [Event]) -> Decoder
[feedDecoder] :: Decoder -> Modifiers -> Char -> Either Decoder [Event]
defaultDecoder :: (Modifiers -> Char -> Maybe Event) -> Decoder
defaultEncode :: Command -> Text
data LocalTerminal
data VirtualTerminal
VirtualTerminal :: VirtualTerminalSettings -> TVar Position -> TVar [String] -> TVar Bool -> TVar Bool -> VirtualTerminal
[virtualSettings] :: VirtualTerminal -> VirtualTerminalSettings
[virtualCursor] :: VirtualTerminal -> TVar Position
[virtualWindow] :: VirtualTerminal -> TVar [String]
[virtualAutoWrap] :: VirtualTerminal -> TVar Bool
[virtualAlternateScreenBuffer] :: VirtualTerminal -> TVar Bool
data VirtualTerminalSettings
VirtualTerminalSettings :: ByteString -> STM Size -> STM Event -> STM Interrupt -> VirtualTerminalSettings
[virtualType] :: VirtualTerminalSettings -> ByteString
[virtualWindowSize] :: VirtualTerminalSettings -> STM Size
[virtualEvent] :: VirtualTerminalSettings -> STM Event
[virtualInterrupt] :: VirtualTerminalSettings -> STM Interrupt
withVirtualTerminal :: MonadIO m => VirtualTerminalSettings -> (VirtualTerminal -> m a) -> m a
