packages feed

vty-unix 0.1.0.0 → 0.2.0.0

raw patch · 5 files changed

+20/−14 lines, 5 filesdep ~vty

Dependency ranges changed: vty

Files

CHANGELOG.md view
@@ -1,4 +1,13 @@ +0.2.0.0+=======++API changes:+* The `settingColorMode` field of `UnixSettings` was removed in favor of+  Vty 6.1's new `configPreferredColorMode` field of the `VtyUserConfig`+  type. This package now uses that setting if present; otherwise it does+  the same color mode detection that it did before this release.+ 0.1.0.0 ======= 
src/Graphics/Vty/Platform/Unix.hs view
@@ -57,5 +57,5 @@                                 (configTermWidthMaps userConfig)      input <- buildInput userConfig settings-    out <- buildOutput settings+    out <- buildOutput userConfig settings     mkVtyFromPair input out
src/Graphics/Vty/Platform/Unix/Output.hs view
@@ -9,9 +9,11 @@   ) where +import Graphics.Vty.Config import Graphics.Vty.Output  import Graphics.Vty.Platform.Unix.Settings+import Graphics.Vty.Platform.Unix.Output.Color (detectColorMode) import Graphics.Vty.Platform.Unix.Output.XTermColor as XTermColor import Graphics.Vty.Platform.Unix.Output.TerminfoBased as TerminfoBased @@ -33,11 +35,14 @@ -- * If @TERM@ starts with @xterm@, @screen@, @rxvt@, or @tmux@, this --   will the @xterm@-based implementation. -- * Otherwise this will use the 'TerminfoBased' implementation.-buildOutput :: UnixSettings -> IO Output-buildOutput settings = do+buildOutput :: VtyUserConfig -> UnixSettings -> IO Output+buildOutput config settings = do     let termName = settingTermName settings         fd = settingOutputFd settings-        colorMode = settingColorMode settings++    colorMode <- case configPreferredColorMode config of+        Nothing -> detectColorMode termName+        Just m -> return m      t <- if isXtermLike termName          then XTermColor.reserveTerminal termName fd colorMode
src/Graphics/Vty/Platform/Unix/Settings.hs view
@@ -27,9 +27,6 @@ import System.Posix.IO (stdInput, stdOutput) import System.Posix.Types (Fd(..)) -import Graphics.Vty.Attributes.Color-import Graphics.Vty.Platform.Unix.Output.Color (detectColorMode)- -- | Type of exceptions that can be raised when configuring Vty on a -- Unix system. data VtyUnixConfigurationError =@@ -56,9 +53,6 @@                  -- ^ The output file descriptor to use.                  , settingTermName :: String                  -- ^ The terminal name used to look up terminfo capabilities.-                 , settingColorMode :: ColorMode-                 -- ^ The color mode used to know how many colors the terminal-                 -- supports.                  }                  deriving (Show, Eq) @@ -69,14 +63,12 @@     case mb of       Nothing -> throwIO MissingTermEnvVar       Just t -> do-        mcolorMode <- detectColorMode t         flushStdin         return $ UnixSettings { settingVmin      = 1                               , settingVtime     = 100                               , settingInputFd   = stdInput                               , settingOutputFd  = stdOutput                               , settingTermName  = t-                              , settingColorMode = mcolorMode                               }  termVariable :: String
vty-unix.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               vty-unix-version:            0.1.0.0+version:            0.2.0.0 synopsis:           Unix backend for Vty description:        This package provides Unix terminal support for Vty. license:            BSD-3-Clause@@ -53,7 +53,7 @@                       mtl,                       unix,                       terminfo,-                      vty >= 6.0,+                      vty >= 6.1,                       deepseq,                       vector,                       parsec,