@@ -3,11 +3,7 @@
3{-# OPTIONS_GHC -D_XOPEN_SOURCE=500 -fno-warn-warnings-deprecations #-}
3{-# OPTIONS_GHC -D_XOPEN_SOURCE=500 -fno-warn-warnings-deprecations #-}
4{-# CFILES gwinsz.c #-}
4{-# CFILES gwinsz.c #-}
6−-- | Terminfo based terminal handling.
6+-- | Terminfo-based terminal output driver.
8−-- The color handling assumes tektronix like. No HP support provided. If
9−-- the terminal is not one I have easy access to then color support is
10−-- entirely based of the docs. Probably with some assumptions mixed in.
12-- Copyright Corey O'Connor (coreyoconnor@gmail.com)
8-- Copyright Corey O'Connor (coreyoconnor@gmail.com)
13module Graphics.Vty.Output.TerminfoBased
9module Graphics.Vty.Output.TerminfoBased
@@ -89,14 +85,16 @@ sendCapToTerminal :: Output -> CapExpression -> [CapParam] -> IO ()
89sendCapToTerminal t cap capParams = do
85sendCapToTerminal t cap capParams = do
90 outputByteBuffer t $ writeToByteString $ writeCapExpr cap capParams
86 outputByteBuffer t $ writeToByteString $ writeCapExpr cap capParams
88+-- | Constructs an output driver that uses terminfo for all control
92−-- | Uses terminfo for all control codes. While this should provide the
89+-- codes. While this should provide the most compatible terminal,
93−-- most compatible terminal terminfo does not support some features that
90+-- terminfo does not support some features that would increase
94−-- would increase efficiency and improve compatibility:
91+-- efficiency and improve compatibility:
96−-- * determine the character encoding supported by the terminal. Should
93+-- * determining the character encoding supported by the terminal.
97−-- this be taken from the LANG environment variable?
94+-- Should this be taken from the LANG environment variable?
99−-- * Provide independent string capabilities for all display attributes.
96+-- * Providing independent string capabilities for all display
100reserveTerminal :: ( Applicative m, MonadIO m ) => String -> Fd -> m Output
98reserveTerminal :: ( Applicative m, MonadIO m ) => String -> Fd -> m Output
101reserveTerminal termName outFd = liftIO $ do
99reserveTerminal termName outFd = liftIO $ do
102 ti <- Terminfo.setupTerm termName
100 ti <- Terminfo.setupTerm termName