Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-ansi-terminal for
openSUSE:Factory checked in at 2025-12-19 16:45:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-ansi-terminal (Old)
and /work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new.1928 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-ansi-terminal"
Fri Dec 19 16:45:38 2025 rev:28 rq:1323024 version:1.1.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-ansi-terminal/ghc-ansi-terminal.changes
2025-07-23 16:36:25.722925876 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new.1928/ghc-ansi-terminal.changes
2025-12-19 16:48:58.709731861 +0100
@@ -1,0 +2,13 @@
+Sun Dec 7 20:14:08 UTC 2025 - Peter Simons <[email protected]>
+
+- Update ansi-terminal to version 1.1.4.
+ Version 1.1.4
+ -------------
+
+ * Fixes `hGetCursorPosition` and `hGetLayerColor` on Windows, allowing time
for
+ reported information to reach the standard input channel.
+ * Improvements to Haddock documentation.
+ * The executable `ansi-terminal-example` allows individual examples to be
+ selected.
+
+-------------------------------------------------------------------
Old:
----
ansi-terminal-1.1.3.tar.gz
New:
----
ansi-terminal-1.1.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-ansi-terminal.spec ++++++
--- /var/tmp/diff_new_pack.UBb0lj/_old 2025-12-19 16:49:01.525849627 +0100
+++ /var/tmp/diff_new_pack.UBb0lj/_new 2025-12-19 16:49:01.525849627 +0100
@@ -19,7 +19,7 @@
%global pkg_name ansi-terminal
%global pkgver %{pkg_name}-%{version}
Name: ghc-%{pkg_name}
-Version: 1.1.3
+Version: 1.1.4
Release: 0
Summary: Simple ANSI terminal support
License: BSD-3-Clause
++++++ ansi-terminal-1.1.3.tar.gz -> ansi-terminal-1.1.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-1.1.3/CHANGELOG.md
new/ansi-terminal-1.1.4/CHANGELOG.md
--- old/ansi-terminal-1.1.3/CHANGELOG.md 2025-07-18 22:14:18.000000000
+0200
+++ new/ansi-terminal-1.1.4/CHANGELOG.md 2025-12-07 21:07:05.000000000
+0100
@@ -1,6 +1,15 @@
Changes
=======
+Version 1.1.4
+-------------
+
+* Fixes `hGetCursorPosition` and `hGetLayerColor` on Windows, allowing time for
+ reported information to reach the standard input channel.
+* Improvements to Haddock documentation.
+* The executable `ansi-terminal-example` allows individual examples to be
+ selected.
+
Version 1.1.3
-------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-1.1.3/ansi-terminal.cabal
new/ansi-terminal-1.1.4/ansi-terminal.cabal
--- old/ansi-terminal-1.1.3/ansi-terminal.cabal 2025-07-18 22:14:18.000000000
+0200
+++ new/ansi-terminal-1.1.4/ansi-terminal.cabal 2025-12-07 20:34:38.000000000
+0100
@@ -1,6 +1,6 @@
Cabal-Version: 1.22
Name: ansi-terminal
-Version: 1.1.3
+Version: 1.1.4
Category: User Interfaces
Synopsis: Simple ANSI terminal support
Description: ANSI terminal support for Haskell: allows cursor movement,
@@ -23,7 +23,7 @@
type: git
location: git://github.com/UnkindPartition/ansi-terminal.git
-Flag Example
+Flag example
Description: Build the example application
Default: False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-1.1.3/app/Example.hs
new/ansi-terminal-1.1.4/app/Example.hs
--- old/ansi-terminal-1.1.3/app/Example.hs 2024-12-31 15:14:24.000000000
+0100
+++ new/ansi-terminal-1.1.4/app/Example.hs 2025-09-17 21:24:43.000000000
+0200
@@ -11,34 +11,56 @@
import Data.Colour.SRGB (sRGB24)
import System.Console.ANSI
+import System.Environment ( getArgs )
-examples :: [IO ()]
-examples = [ cursorMovementExample
- , lineChangeExample
- , setCursorPositionExample
- , saveRestoreCursorExample
- , clearExample
- , lineWrapExample
- , scrollExample
- , screenBuffersExample
- , sgrColorExample
- , sgrOtherExample
- , cursorVisibilityExample
- , hyperlinkExample
- , titleExample
- , getCursorPositionExample
- , getTerminalSizeExample
- , getLayerColorExample
- ]
+examples :: [(String, IO ())]
+examples =
+ [ ( "Cursor movement", cursorMovementExample )
+ , ( "Line change", lineChangeExample )
+ , ( "Set cursor position", setCursorPositionExample )
+ , ( "Save restore cursor", saveRestoreCursorExample )
+ , ( "Clear", clearExample )
+ , ( "Line wrap", lineWrapExample )
+ , ( "Scroll", scrollExample )
+ , ( "Screen buffers", screenBuffersExample )
+ , ( "SGR color", sgrColorExample )
+ , ( "SGR other", sgrOtherExample )
+ , ( "Cursor visibility", cursorVisibilityExample )
+ , ( "Hyperlink", hyperlinkExample )
+ , ( "Title", titleExample )
+ , ( "Get cursor position", getCursorPositionExample )
+ , ( "Get terminal size", getTerminalSizeExample )
+ , ( "Get layer color", getLayerColorExample )
+ ]
main :: IO ()
main = do
- stdoutSupportsANSI <- hNowSupportsANSI stdout
- if stdoutSupportsANSI
+ args <- getArgs
+ let numExamples = zip [1 ..] examples
+ if wantHelp args
then
- mapM_ (resetScreen >>) examples
- else
- putStrLn "Standard output does not support 'ANSI' escape codes."
+ listExamples numExamples
+ else do
+ let wantedNumExamples = filter (isExample args) numExamples
+ wantedExamples = map getExample wantedNumExamples
+ stdoutSupportsANSI <- hNowSupportsANSI stdout
+ if stdoutSupportsANSI
+ then
+ mapM_ (resetScreen >>) wantedExamples
+ else
+ putStrLn "Standard output does not support 'ANSI' escape codes."
+ where
+ wantHelp :: [String] -> Bool
+ wantHelp args = "-h" `elem` args || "--help" `elem` args
+
+ listExamples :: [(Int, (String, IO ()))] -> IO ()
+ listExamples = mapM_ (\(n, (d, _)) -> putStrLn $ show n ++ ": " ++ d)
+
+ isExample :: [String] -> (Int, (String, IO ())) -> Bool
+ isExample args (n, _) = show n `elem` args
+
+ getExample :: (Int, (String, IO ())) -> IO ()
+ getExample (_, (_, example)) = example
-- Annex D to Standard ECMA-48 (5th Ed, 1991) identifies that the
representation
-- of an erased state is implementation-dependent. There may or may not be a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ansi-terminal-1.1.3/src/System/Console/ANSI.hs
new/ansi-terminal-1.1.4/src/System/Console/ANSI.hs
--- old/ansi-terminal-1.1.3/src/System/Console/ANSI.hs 2024-12-31
15:14:24.000000000 +0100
+++ new/ansi-terminal-1.1.4/src/System/Console/ANSI.hs 2025-09-17
21:24:43.000000000 +0200
@@ -384,6 +384,7 @@
, hSupportsANSIWithoutEmulation
) where
+import Control.Concurrent (threadDelay)
import Control.Exception.Base ( bracket )
import Control.Monad ( when, void )
import Data.Char ( digitToInt, isDigit, isHexDigit )
@@ -648,7 +649,7 @@
-- the processing of \'ANSI\' control characters in output is not enabled, this
-- function first tries to enable such processing.
--
--- @Since 1.0.1
+-- @since 1.0.1
hNowSupportsANSI :: Handle -> IO Bool
hNowSupportsANSI = Internal.hNowSupportsANSI
@@ -741,6 +742,8 @@
-- as mintty, that are not based on the Windows' Console API. (Command Prompt
-- and PowerShell are based on the Console API.)
--
+-- This operation may fail with an error if 'stdin' has been redirected.
+--
-- @since 0.10.3
getCursorPosition :: IO (Maybe (Int, Int))
getCursorPosition = hGetCursorPosition stdout
@@ -759,6 +762,8 @@
-- as mintty, that are not based on the Windows' Console API. (Command Prompt
-- and PowerShell are based on the Console API.)
--
+-- This operation may fail with an error if 'stdin' has been redirected.
+--
-- @since 0.10.1
hGetCursorPosition :: Handle -> IO (Maybe (Int, Int))
hGetCursorPosition h = fmap to0base <$> getCursorPosition'
@@ -775,8 +780,13 @@
hSetEcho stdin False
clearStdin
hReportCursorPosition h
- hFlush h -- ensure the report cursor position code is sent to the
- -- operating system
+ -- Ensure the report cursor position code is sent to the operating
+ -- system:
+ hFlush h
+ -- On Windows and in Windows Terminal v1.22.12111.0 (at least), it
seems
+ -- that a moment's delay is required in order to allow sufficient time
+ -- for the reported information to reach the standard input channel:
+ threadDelay 1
getReportedCursorPosition
case readP_to_S cursorPosition input of
[] -> pure Nothing
@@ -858,6 +868,8 @@
--
-- Underlining is not supported.
--
+-- This operation may fail with an error if 'stdin' has been redirected.
+--
-- @since 0.11.4
getLayerColor :: ConsoleLayer -> IO (Maybe(RGB Word16))
getLayerColor = hGetLayerColor stdout
@@ -876,6 +888,8 @@
--
-- Underlining is not supported.
--
+-- This operation may fail with an error if 'stdin' has been redirected.
+--
-- @since 0.11.4
hGetLayerColor :: Handle -> ConsoleLayer -> IO (Maybe (RGB Word16))
hGetLayerColor h layer = do
@@ -889,8 +903,12 @@
hSetEcho stdin False
clearStdin
hReportLayerColor h layer
- hFlush h -- ensure the report cursor position code is sent to the
- -- operating system
+ -- Ensure the report cursor position code is sent to the operating
system:
+ hFlush h
+ -- On Windows and in Windows Terminal v1.22.12111.0 (at least), it seems
+ -- that a moment's delay is required in order to allow sufficient time
for
+ -- the reported information to reach the standard input channel:
+ threadDelay 1
getReportedLayerColor layer
case readP_to_S (layerColor layer) input of
[] -> pure Nothing
@@ -966,6 +984,8 @@
-- as mintty, that are not based on Windows' Console API. (Command Prompt and
-- PowerShell are based on the Console API.)
--
+-- This operation may fail with an error if 'stdin' has been redirected.
+--
-- For a different approach, one that does not use control character sequences
-- and works when 'stdin' is redirected, see the
-- <https://hackage.haskell.org/package/terminal-size terminal-size> package.
@@ -989,6 +1009,8 @@
-- as mintty, that are not based on the Windows' Console API. (Command Prompt
-- and PowerShell are based on the Console API.)
--
+-- This operation may fail with an error if 'stdin' has been redirected.
+--
-- For a different approach, one that does not use control character sequences
-- and works when 'stdin' is redirected, see the
-- <https://hackage.haskell.org/package/terminal-size terminal-size> package.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/ansi-terminal-1.1.3/unix/System/Console/ANSI/Internal.hs
new/ansi-terminal-1.1.4/unix/System/Console/ANSI/Internal.hs
--- old/ansi-terminal-1.1.3/unix/System/Console/ANSI/Internal.hs
2024-06-21 21:26:03.000000000 +0200
+++ new/ansi-terminal-1.1.4/unix/System/Console/ANSI/Internal.hs
2025-09-17 21:24:43.000000000 +0200
@@ -92,7 +92,7 @@
-- This approach is taken because the use of C function setenv() in one thread
-- can cause other threads calling C function getenv() to crash. On Unix-like
-- operating systems, System.Environment.lookupEnv is implemented using C
--- function getenv().
+-- function getenv().
isNotDumb :: Bool
isNotDumb = unsafePerformIO (lookupEnv "TERM") /= Just "dumb"
@@ -102,7 +102,7 @@
-- INSIDE_EMACS environment variable exists, that will not change. This
approach
-- is taken because the use of C function setenv() in one thread can cause
other
-- threads calling C function getenv() to crash. On Unix-like operating
systems,
--- System.Environment.lookupEnv is implemented using C function getenv().
+-- System.Environment.lookupEnv is implemented using C function getenv().
insideEmacs :: Bool
insideEmacs = isJust $ unsafePerformIO (lookupEnv "INSIDE_EMACS")