| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Description | |||||||||||||||||||||||||||||||||||||||
This module provides a low-level interface to the C functions of the terminfo library. NOTE: Since this library is built on top of the curses interface, it is not thread-safe. | |||||||||||||||||||||||||||||||||||||||
Synopsis | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Initialization | |||||||||||||||||||||||||||||||||||||||
data Terminal | |||||||||||||||||||||||||||||||||||||||
setupTerm :: String -> IO Terminal | |||||||||||||||||||||||||||||||||||||||
Initialize the terminfo library to the given terminal entry. Throws a SetupTermError if the terminfo database could not be read. | |||||||||||||||||||||||||||||||||||||||
setupTermFromEnv :: IO Terminal | |||||||||||||||||||||||||||||||||||||||
Initialize the terminfo library, using the TERM environmental variable. If TERM is not set, we use the generic, minimal entry dumb. Throws a SetupTermError if the terminfo database could not be read. | |||||||||||||||||||||||||||||||||||||||
data SetupTermError | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Capabilities | |||||||||||||||||||||||||||||||||||||||
data Capability a | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
getCapability :: Terminal -> Capability a -> Maybe a | |||||||||||||||||||||||||||||||||||||||
tiGetFlag :: String -> Capability Bool | |||||||||||||||||||||||||||||||||||||||
Look up a boolean capability in the terminfo database. Unlike tiGuardFlag, this capability never fails; it returns False if the capability is absent or set to false, and returns True otherwise. | |||||||||||||||||||||||||||||||||||||||
tiGuardFlag :: String -> Capability () | |||||||||||||||||||||||||||||||||||||||
Look up a boolean capability in the terminfo database, and fail if it's not defined. | |||||||||||||||||||||||||||||||||||||||
tiGetNum :: String -> Capability Int | |||||||||||||||||||||||||||||||||||||||
Look up a numeric capability in the terminfo database. | |||||||||||||||||||||||||||||||||||||||
tiGetStr :: String -> Capability String | |||||||||||||||||||||||||||||||||||||||
Look up a string capability in the terminfo database. Note: Do not use this function for terminal output; use tiGetOutput instead. | |||||||||||||||||||||||||||||||||||||||
Output | |||||||||||||||||||||||||||||||||||||||
data TermOutput | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
runTermOutput :: Terminal -> TermOutput -> IO () | |||||||||||||||||||||||||||||||||||||||
Write the terminal output to the standard output device. | |||||||||||||||||||||||||||||||||||||||
hRunTermOutput :: Handle -> Terminal -> TermOutput -> IO () | |||||||||||||||||||||||||||||||||||||||
Write the terminal output to the terminal or file managed by the given Handle. | |||||||||||||||||||||||||||||||||||||||
termText :: String -> TermOutput | |||||||||||||||||||||||||||||||||||||||
Output plain text containing no control characters or escape sequences. | |||||||||||||||||||||||||||||||||||||||
tiGetOutput :: String -> Capability ([Int] -> LinesAffected -> TermOutput) | |||||||||||||||||||||||||||||||||||||||
Look up an output capability in the terminfo database. | |||||||||||||||||||||||||||||||||||||||
type LinesAffected = Int | |||||||||||||||||||||||||||||||||||||||
A parameter to specify the number of lines affected. Some capabilities (e.g., clear and dch1) use this parameter on some terminals to compute variable-length padding. | |||||||||||||||||||||||||||||||||||||||
tiGetOutput1 :: OutputCap f => String -> Capability f | |||||||||||||||||||||||||||||||||||||||
Look up an output capability which takes a fixed number of parameters (for example, Int -> Int -> TermOutput). For capabilities which may contain variable-length padding, use tiGetOutput instead. | |||||||||||||||||||||||||||||||||||||||
class OutputCap f | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Monoid functions | |||||||||||||||||||||||||||||||||||||||
Monoid (mempty, mappend, mconcat) | |||||||||||||||||||||||||||||||||||||||
(<#>) :: Monoid m => m -> m -> m | |||||||||||||||||||||||||||||||||||||||
An operator version of mappend. | |||||||||||||||||||||||||||||||||||||||
Produced by Haddock version 2.4.2 |