-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell bindings to the terminfo library. -- -- This library provides an interface to the terminfo database (via -- bindings to the curses library). Terminfo allows programs to interact -- with a variety of terminals using a standard set of capabilities. @package terminfo @version 0.2.2 -- | 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. module System.Console.Terminfo.Base data Terminal -- | Initialize the terminfo library to the given terminal entry. setupTerm :: String -> IO Terminal -- | Initialize the terminfo library, using the TERM environmental -- variable. If TERM is not set, we use the generic, minimal -- entry dumb. setupTermFromEnv :: IO Terminal -- | A feature or operation which a Terminal may define. data Capability a getCapability :: Terminal -> Capability a -> Maybe a -- | 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. tiGetFlag :: String -> Capability Bool -- | Look up a boolean capability in the terminfo database, and fail if -- it's not defined. tiGuardFlag :: String -> Capability () -- | Look up a numeric capability in the terminfo database. tiGetNum :: String -> Capability Int -- | Look up a string capability in the terminfo database. -- -- Note: Do not use this function for terminal output; use -- tiGetOutput instead. tiGetStr :: String -> Capability String -- | An action which sends output to the terminal. That output may mix -- plain text with control characters and escape sequences, along with -- delays (called "padding") required by some older terminals. data TermOutput -- | Write the terminal output to the standard output device. runTermOutput :: Terminal -> TermOutput -> IO () -- | Write the terminal output to the terminal or file managed by the given -- Handle. hRunTermOutput :: Handle -> Terminal -> TermOutput -> IO () -- | Output plain text containing no control characters or escape -- sequences. termText :: String -> TermOutput -- | Look up an output capability in the terminfo database. tiGetOutput :: String -> Capability ([Int] -> LinesAffected -> TermOutput) -- | 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. type LinesAffected = Int -- | 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. tiGetOutput1 :: (OutputCap f) => String -> Capability f -- | A type class to encapsulate capabilities which take in zero or more -- parameters. class OutputCap f -- | The class of monoids (types with an associative binary operation that -- has an identity). Instances should satisfy the following laws: -- --
-- replicateM_ 5 $ putStr $ replicate 80 'x' ++ "\n" --wraparoundGlitch :: Capability Bool -- | The cr capability, which moves the cursor to the first column -- of the current line. carriageReturn :: Capability TermOutput -- | The nel capability, which moves the cursor to the first -- column of the next line. It behaves like a carriage return followed by -- a line feed. -- -- If nel is not defined, this may be built out of other -- capabilities. newline :: Capability TermOutput scrollForward :: Capability TermOutput scrollReverse :: Capability TermOutput moveDown :: Capability (Int -> TermOutput) moveLeft :: Capability (Int -> TermOutput) moveRight :: Capability (Int -> TermOutput) moveUp :: Capability (Int -> TermOutput) cursorDown1 :: Capability TermOutput cursorLeft1 :: Capability TermOutput cursorRight1 :: Capability TermOutput cursorUp1 :: Capability TermOutput cursorDown :: Capability (Int -> TermOutput) cursorLeft :: Capability (Int -> TermOutput) cursorRight :: Capability (Int -> TermOutput) cursorUp :: Capability (Int -> TermOutput) cursorAddress :: Capability (Point -> TermOutput) data Point Point :: Int -> Int -> Point row :: Point -> Int col :: Point -> Int rowAddress :: Capability (Int -> TermOutput) columnAddress :: Capability (Int -> TermOutput) module System.Console.Terminfo.Effects bell :: Capability TermOutput visualBell :: Capability TermOutput withStandout :: Capability (TermOutput -> TermOutput) withUnderline :: Capability (TermOutput -> TermOutput) enterStandoutMode :: Capability TermOutput exitStandoutMode :: Capability TermOutput enterUnderlineMode :: Capability TermOutput exitUnderlineMode :: Capability TermOutput module System.Console.Terminfo.Edit -- | Clear the screen, and move the cursor to the upper left. clearScreen :: Capability (LinesAffected -> TermOutput) -- | Clear from beginning of line to cursor. clearBOL :: Capability TermOutput -- | Clear from cursor to end of line. clearEOL :: Capability TermOutput -- | Clear display after cursor. clearEOS :: Capability (LinesAffected -> TermOutput) module System.Console.Terminfo