packages feed

vty 5.31 → 5.32

raw patch · 7 files changed

+43/−6 lines, 7 files

Files

CHANGELOG.md view
@@ -1,4 +1,16 @@ +5.32+----++New features:+ * Meta-PageUp and Meta-PageDown are now supported (#193)+ * Added `supportsItalics` and `supportsStrikethrough` functions to+   check for feature support in terminfo++Bug fixes:+ * Detect utf-8 mode in `LANG` regardless of case (thanks Emeka+   Nkurumeh)+ 5.31 ---- 
src/Graphics/Vty/Input/Terminfo.hs view
@@ -86,8 +86,10 @@ -- | Esc, meta-esc, delete, meta-delete, enter, meta-enter. specialSupportKeys :: ClassifyMap specialSupportKeys =-    [ -- special support for ESC-      ("\ESC",EvKey KEsc []), ("\ESC\ESC",EvKey KEsc [MMeta])+    [ ("\ESC\ESC[5~",EvKey KPageUp [MMeta])+    , ("\ESC\ESC[6~",EvKey KPageDown [MMeta])+    -- special support for ESC+    , ("\ESC",EvKey KEsc []), ("\ESC\ESC",EvKey KEsc [MMeta])     -- Special support for backspace     , ("\DEL",EvKey KBS []), ("\ESC\DEL",EvKey KBS [MMeta])     -- Special support for Enter
src/Graphics/Vty/Output/Interface.hs view
@@ -101,6 +101,22 @@     , ringTerminalBell :: IO ()       -- | Returns whether the terminal has an audio bell feature.     , supportsBell :: IO Bool+      -- | Returns whether the terminal supports italicized text.+      --+      -- This is terminal-dependent and should make a best effort to+      -- determine whether this feature is supported, but even if the+      -- terminal advertises support (e.g. via terminfo) that might not+      -- be a reliable indicator of whether the feature will work as+      -- desired.+    , supportsItalics :: IO Bool+      -- | Returns whether the terminal supports strikethrough text.+      --+      -- This is terminal-dependent and should make a best effort to+      -- determine whether this feature is supported, but even if the+      -- terminal advertises support (e.g. via terminfo) that might not+      -- be a reliable indicator of whether the feature will work as+      -- desired.+    , supportsStrikethrough :: IO Bool     }  displayContext :: Output -> DisplayRegion -> IO DisplayContext
src/Graphics/Vty/Output/Mock.hs view
@@ -48,6 +48,8 @@             , releaseDisplay = return ()             , ringTerminalBell = return ()             , supportsBell = return False+            , supportsItalics = return False+            , supportsStrikethrough = return False             , setDisplayBounds = const $ return ()             , displayBounds = return r             , outputByteBuffer = \bytes -> do
src/Graphics/Vty/Output/TerminfoBased.hs view
@@ -168,6 +168,10 @@                 sendCap setDefaultAttr []                 maybeSendCap cnorm []             , supportsBell = return $ isJust $ ringBellAudio terminfoCaps+            , supportsItalics = return $ (isJust $ enterItalic (displayAttrCaps terminfoCaps)) &&+                                         (isJust $ exitItalic (displayAttrCaps terminfoCaps))+            , supportsStrikethrough = return $ (isJust $ enterStrikethrough (displayAttrCaps terminfoCaps)) &&+                                               (isJust $ exitStrikethrough (displayAttrCaps terminfoCaps))             , ringTerminalBell = maybeSendCap ringBellAudio []             , reserveDisplay = do                 -- If there is no support for smcup: Clear the screen
src/Graphics/Vty/Output/XTermColor.hs view
@@ -17,6 +17,7 @@  import Control.Monad (void, when) import Control.Monad.Trans+import Data.Char (toLower) import Data.IORef  import System.Posix.IO (fdWrite)@@ -92,9 +93,9 @@ utf8Active :: IO Bool utf8Active = do     let vars = ["LC_ALL", "LANG", "LC_CTYPE"]-    results <- catMaybes <$> mapM getEnv vars-    let matches = filter ("UTF8" `isInfixOf`) results <>-                  filter ("UTF-8" `isInfixOf`) results+    results <- map (toLower <$>) . catMaybes <$> mapM getEnv vars+    let matches = filter ("utf8" `isInfixOf`) results <>+                  filter ("utf-8" `isInfixOf`) results     return $ not $ null matches  -- | Enable bracketed paste mode:
vty.cabal view
@@ -1,5 +1,5 @@ name:                vty-version:             5.31+version:             5.32 license:             BSD3 license-file:        LICENSE author:              AUTHORS