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 2022-08-01 21:29:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-ansi-terminal (Old) and /work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-ansi-terminal" Mon Aug 1 21:29:31 2022 rev:21 rq:987017 version:0.11.3 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-ansi-terminal/ghc-ansi-terminal.changes 2022-02-11 23:10:29.095132593 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-ansi-terminal.new.1533/ghc-ansi-terminal.changes 2022-08-01 21:29:34.529514717 +0200 @@ -1,0 +2,9 @@ +Thu Apr 28 23:10:27 UTC 2022 - Peter Simons <psimons@suse.com> + +- Update ansi-terminal to version 0.11.3. + Upstream has edited the change log file since the last release in + a non-trivial way, i.e. they did more than just add a new entry + at the top. You can review the file at: + http://hackage.haskell.org/package/ansi-terminal-0.11.3/src/CHANGELOG.md + +------------------------------------------------------------------- Old: ---- ansi-terminal-0.11.1.tar.gz New: ---- ansi-terminal-0.11.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-ansi-terminal.spec ++++++ --- /var/tmp/diff_new_pack.HlIdvB/_old 2022-08-01 21:29:35.017516117 +0200 +++ /var/tmp/diff_new_pack.HlIdvB/_new 2022-08-01 21:29:35.021516129 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-ansi-terminal # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %global pkg_name ansi-terminal Name: ghc-%{pkg_name} -Version: 0.11.1 +Version: 0.11.3 Release: 0 Summary: Simple ANSI terminal support, with Windows compatibility License: BSD-3-Clause ++++++ ansi-terminal-0.11.1.tar.gz -> ansi-terminal-0.11.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/CHANGELOG.md new/ansi-terminal-0.11.3/CHANGELOG.md --- old/ansi-terminal-0.11.1/CHANGELOG.md 2021-11-23 22:07:49.000000000 +0100 +++ new/ansi-terminal-0.11.3/CHANGELOG.md 2022-04-29 01:06:08.000000000 +0200 @@ -1,6 +1,19 @@ Changes ======= +Version 0.11.3 +-------------- + +* Add `hyperlink`, `hyperlinkWithId` and `hyperlinkWithParams`, and support for + clicable hyperlinks. + +Version 0.11.2 +-------------- + +* On Windows, fix compatability with the Windows I/O Manager (WinIO) when + GHC >= 9.0.1 but `Win32` < 2.9.0.0. +* Improvements to Haddock documentation. + Version 0.11.1 -------------- @@ -78,9 +91,9 @@ Version 0.8.1 ------------- -* Add `hSupportsANSIWithoutEmulation`. On Windows 10, if the handle is identifed - as connected to a native terminal ('Command Prompt' or 'PowerShell'), the - processing of 'ANSI' control characters will be enabled. +* Add `hSupportsANSIWithoutEmulation`. On Windows 10, if the handle is + identified as connected to a native terminal ('Command Prompt' or + 'PowerShell'), the processing of 'ANSI' control characters will be enabled. Version 0.8.0.4 --------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/README.md new/ansi-terminal-0.11.3/README.md --- old/ansi-terminal-0.11.1/README.md 2021-11-23 21:48:27.000000000 +0100 +++ new/ansi-terminal-0.11.3/README.md 2022-04-29 01:00:01.000000000 +0200 @@ -16,6 +16,7 @@ - Moving the cursor around - Reporting the position of the cursor - Scrolling the screen up or down +- Clickable hyperlinks to URIs - Changing the title of the terminal By using emulation, it is compatible with versions of 'Command Prompt' and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/ansi-terminal.cabal new/ansi-terminal-0.11.3/ansi-terminal.cabal --- old/ansi-terminal-0.11.1/ansi-terminal.cabal 2021-11-23 22:07:49.000000000 +0100 +++ new/ansi-terminal-0.11.3/ansi-terminal.cabal 2022-04-29 01:04:07.000000000 +0200 @@ -1,5 +1,5 @@ Name: ansi-terminal -Version: 0.11.1 +Version: 0.11.3 Cabal-Version: >= 1.10 Category: User Interfaces Synopsis: Simple ANSI terminal support, with Windows compatibility diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/app/Example.hs new/ansi-terminal-0.11.3/app/Example.hs --- old/ansi-terminal-0.11.1/app/Example.hs 2021-11-23 21:48:27.000000000 +0100 +++ new/ansi-terminal-0.11.3/app/Example.hs 2022-04-29 01:00:01.000000000 +0200 @@ -22,13 +22,14 @@ , sgrColorExample , sgrOtherExample , cursorVisibilityExample + , hyperlinkExample , titleExample , getCursorPositionExample , getTerminalSizeExample ] main :: IO () -main = mapM_ (\example -> resetScreen >> example) examples +main = mapM_ (resetScreen >>) examples -- 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 @@ -229,7 +230,7 @@ forM_ colors $ \color -> do setSGR [Reset] setSGR [SetColor layer intensity color] - putStrLn (show color) + print color pause -- The ANSI eight standard colors, 4 times in sequence (two layers and two -- intensities) @@ -365,6 +366,22 @@ pause -- Cursor Demo| +hyperlinkExample :: IO () +hyperlinkExample = do + putStr "Hyperlink demo: " + hyperlink "https://example.com" "Example hyperlink\n" + putStrLn "" + putStrLn "Linked hyperlinks demo:" + hyperlinkWithId "ref" "https://example.com" "Example linked hyperlink one\n" + hyperlinkWithId "ref" "https://example.com" "Example linked hyperlink two\n" + + replicateM_ 5 pause + -- Hyperlink demo: Example hyperlink + -- + -- Linked hyperlinks demo: + -- Example linked hyperlink one + -- Example linked hyperlink two + titleExample :: IO () titleExample = do putStr "Title Demo" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/src/System/Console/ANSI/Codes.hs new/ansi-terminal-0.11.3/src/System/Console/ANSI/Codes.hs --- old/ansi-terminal-0.11.1/src/System/Console/ANSI/Codes.hs 2021-11-23 21:48:27.000000000 +0100 +++ new/ansi-terminal-0.11.3/src/System/Console/ANSI/Codes.hs 2022-04-29 01:00:01.000000000 +0200 @@ -47,20 +47,19 @@ -- * Cursor visibilty changes , hideCursorCode, showCursorCode + -- * Hyperlinks + -- | Some, but not all, terminals support hyperlinks - that is, clickable + -- text that points to a URI. + , hyperlinkCode, hyperlinkWithIdCode, hyperlinkWithParamsCode + -- * Changing the title - -- | Thanks to Brandon S. Allbery and Curt Sampson for pointing me in the - -- right direction on xterm title setting on haskell-cafe. The "0" - -- signifies that both the title and "icon" text should be set: i.e. the - -- text for the window in the Start bar (or similar) as well as that in - -- the actual window title. This is chosen for consistent behaviour - -- between Unixes and Windows. , setTitleCode -- * Utilities , colorToCode, csi, sgrToCode ) where -import Data.List (intersperse) +import Data.List (intercalate) import Data.Colour.SRGB (toSRGB24, RGB (..)) @@ -74,7 +73,7 @@ csi :: [Int] -- ^ List of parameters for the control sequence -> String -- ^ Character(s) that identify the control function -> String -csi args code = "\ESC[" ++ concat (intersperse ";" (map show args)) ++ code +csi args code = "\ESC[" ++ intercalate ";" (map show args) ++ code -- | 'colorToCode' @color@ returns the 0-based index of the color (one of the -- eight colors in the ANSI standard). @@ -206,8 +205,57 @@ hideCursorCode = csi [] "?25l" showCursorCode = csi [] "?25h" +-- | Code to introduce a hyperlink with (key, value) parameters. Some terminals +-- support an @id@ parameter key, so that hyperlinks with the same @id@ value +-- are treated as connected. +-- +-- @since 0.11.3 +hyperlinkWithParamsCode + :: [(String, String)] + -- ^ Parameters + -> String + -- ^ URI + -> String + -- ^ Link text + -> String +hyperlinkWithParamsCode ps uri link = + "\ESC]8;" ++ ps' ++ ";" ++ uri ++ "\ESC\\" ++ link ++ "\ESC]8;;\ESC\\" + where + ps' = intercalate ":" $ map (\(k, v) -> k ++ "=" ++ v) ps + +-- | Code to introduce a hyperlink. +-- +-- @since 0.11.3 +hyperlinkCode + :: String + -- ^ URI + -> String + -- ^ Link text + -> String +hyperlinkCode = hyperlinkWithParamsCode [] + +-- | Code to introduce a hyperlink with an identifier for the link. Some +-- terminals support an identifier, so that hyperlinks with the same identifier +-- are treated as connected. +-- +-- @since 0.11.3 +hyperlinkWithIdCode + :: String + -- ^ Identifier for the link + -> String + -- ^ URI + -> String + -- ^ Link text + -> String +hyperlinkWithIdCode linkId = hyperlinkWithParamsCode [("id", linkId)] + +-- | Code to set the terminal window title and the icon name (that is, the text +-- for the window in the Start bar, or similar). --- | XTerm control sequence to set the Icon Name and Window Title. -setTitleCode :: String -- ^ New Icon Name and Window Title +-- Thanks to Brandon S. Allbery and Curt Sampson for pointing me in the right +-- direction on xterm title setting on haskell-cafe. The "0" signifies that both +-- the title and "icon" text should be set. This is chosen for consistent +-- behaviour between Unixes and Windows. +setTitleCode :: String -- ^ New window title and icon name -> String setTitleCode title = "\ESC]0;" ++ filter (/= '\007') title ++ "\007" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/src/System/Console/ANSI/Unix.hs new/ansi-terminal-0.11.3/src/System/Console/ANSI/Unix.hs --- old/ansi-terminal-0.11.1/src/System/Console/ANSI/Unix.hs 2021-11-23 21:48:27.000000000 +0100 +++ new/ansi-terminal-0.11.3/src/System/Console/ANSI/Unix.hs 2022-04-29 01:00:01.000000000 +0200 @@ -24,7 +24,7 @@ -- This file contains code that is common to modules System.Console.ANSI.Unix, -- System.Console.ANSI.Windows and System.Console.ANSI.Windows.Emulator, such as -- type signatures and the definition of functions specific to stdout in terms --- of the corresponding more general functions, inclduding the related Haddock +-- of the corresponding more general functions, including the related Haddock -- documentation. #include "Common-Include.hs" -- This file contains code that is common save that different code is required @@ -64,6 +64,9 @@ hHideCursor h = hPutStr h hideCursorCode hShowCursor h = hPutStr h showCursorCode +hHyperlinkWithParams h params uri link = + hPutStr h $ hyperlinkWithParamsCode params uri link + hSetTitle h title = hPutStr h $ setTitleCode title -- hSupportsANSI :: Handle -> IO Bool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows/Emulator/Codes.hs new/ansi-terminal-0.11.3/src/System/Console/ANSI/Windows/Emulator/Codes.hs --- old/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows/Emulator/Codes.hs 2021-11-23 21:48:27.000000000 +0100 +++ new/ansi-terminal-0.11.3/src/System/Console/ANSI/Windows/Emulator/Codes.hs 2022-04-29 01:00:01.000000000 +0200 @@ -29,6 +29,9 @@ -- * Cursor visibilty changes , hideCursorCode, showCursorCode + -- * Hyperlinks + , hyperlinkCode, hyperlinkWithIdCode, hyperlinkWithParamsCode + -- * Changing the title , setTitleCode ) where @@ -90,6 +93,26 @@ hideCursorCode = "" showCursorCode = "" +hyperlinkWithParamsCode + :: ([(String, String)]) + -> String + -> String + -> String +hyperlinkWithParamsCode _ _ _ = "" + +hyperlinkCode + :: String + -> String + -> String +hyperlinkCode _ _ = "" + +hyperlinkWithIdCode + :: String + -> String + -> String + -> String +hyperlinkWithIdCode _ _ _ = "" + setTitleCode :: String -- ^ New title -> String setTitleCode _ = "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows/Emulator.hs new/ansi-terminal-0.11.3/src/System/Console/ANSI/Windows/Emulator.hs --- old/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows/Emulator.hs 2021-11-23 21:48:27.000000000 +0100 +++ new/ansi-terminal-0.11.3/src/System/Console/ANSI/Windows/Emulator.hs 2022-04-29 01:00:01.000000000 +0200 @@ -14,7 +14,7 @@ import Data.List (foldl', minimumBy) import Data.Maybe (mapMaybe) import qualified Data.Map.Strict as Map (Map, empty, insert, lookup) -import System.IO (Handle, hIsTerminalDevice, stdin) +import System.IO (Handle, hIsTerminalDevice, hPutStr, stdin) import System.IO.Unsafe (unsafePerformIO) import Text.ParserCombinators.ReadP (readP_to_S) @@ -33,7 +33,7 @@ -- This file contains code that is common to modules System.Console.ANSI.Unix, -- System.Console.ANSI.Windows and System.Console.ANSI.Windows.Emulator, such as -- type signatures and the definition of functions specific to stdout in terms --- of the corresponding more general functions, inclduding the related Haddock +-- of the corresponding more general functions, including the related Haddock -- documentation. #include "Common-Include.hs" -- This file contains code that is required in the case of the module @@ -349,6 +349,8 @@ = emulatorFallback (Unix.hShowCursor h) $ withHandle h $ \handle -> hChangeCursorVisibility handle True +hHyperlinkWithParams h _ _ = hPutStr h + -- Windows only supports setting the terminal title on a process-wide basis, so -- for now we will assume that that is what the user intended. This will fail if -- they are sending the command over e.g. a network link... but that's not @@ -474,14 +476,17 @@ return $ stringFromInputEvents es stringFromInputEvents = cWcharsToChars . wCharsFromInputEvents wCharsFromInputEvents = mapMaybe wCharFromInputEvent - wCharFromInputEvent e = if isKeyDownEvent + wCharFromInputEvent e = if isKeyEvent && isKeyDown then Just (unicodeAsciiChar $ keyEventChar keyEventRecord) else Nothing where eventType = inputEventType e - InputKeyEvent keyEventRecord = inputEvent e + eventRecord = inputEvent e + isKeyEvent = eventType == 1 + keyEventRecord = case eventRecord of + InputKeyEvent keyEventRecord' -> keyEventRecord' + _ -> error "Unexpected input event, given input event type." isKeyDown = keyEventKeyDown keyEventRecord - isKeyDownEvent = eventType == 1 && isKeyDown -- hGetCursorPosition :: Handle -> IO (Maybe (Int, Int)) -- (See Common-Include.hs for Haddock documentation) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows.hs new/ansi-terminal-0.11.3/src/System/Console/ANSI/Windows.hs --- old/ansi-terminal-0.11.1/src/System/Console/ANSI/Windows.hs 2021-11-23 21:48:27.000000000 +0100 +++ new/ansi-terminal-0.11.3/src/System/Console/ANSI/Windows.hs 2022-04-29 01:00:01.000000000 +0200 @@ -20,7 +20,7 @@ -- This file contains code that is common to modules System.Console.ANSI.Unix, -- System.Console.ANSI.Windows and System.Console.ANSI.Windows.Emulator, such as -- type signatures and the definition of functions specific to stdout in terms --- of the corresponding more general functions, inclduding the related Haddock +-- of the corresponding more general functions, including the related Haddock -- documentation. #include "Common-Include.hs" -- This file contains code that is common save that different code is required @@ -173,6 +173,32 @@ showCursorCode :: String showCursorCode = nativeOrEmulated U.showCursorCode E.showCursorCode +-- * Hyperlinks +hHyperlinkWithParams = + nativeOrEmulated U.hHyperlinkWithParams E.hHyperlinkWithParams + +hyperlinkWithParamsCode + :: [(String, String)] + -> String + -> String + -> String +hyperlinkWithParamsCode = + nativeOrEmulated U.hyperlinkWithParamsCode E.hyperlinkWithParamsCode + +hyperlinkCode + :: String + -> String + -> String +hyperlinkCode = nativeOrEmulated U.hyperlinkCode E.hyperlinkCode + +hyperlinkWithIdCode + :: String + -> String + -> String + -> String +hyperlinkWithIdCode = + nativeOrEmulated U.hyperlinkWithIdCode E.hyperlinkWithIdCode + -- * Changing the title hSetTitle = nativeOrEmulated U.hSetTitle E.hSetTitle diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/src/System/Console/ANSI.hs new/ansi-terminal-0.11.3/src/System/Console/ANSI.hs --- old/ansi-terminal-0.11.1/src/System/Console/ANSI.hs 2021-11-23 21:48:27.000000000 +0100 +++ new/ansi-terminal-0.11.3/src/System/Console/ANSI.hs 2022-04-29 01:00:01.000000000 +0200 @@ -21,6 +21,8 @@ * Scrolling the screen up or down + * Clickable hyperlinks to URIs + * Changing the title of the terminal A terminal that supports control character sequences acts on them when they diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/src/System/Win32/Compat.hs new/ansi-terminal-0.11.3/src/System/Win32/Compat.hs --- old/ansi-terminal-0.11.1/src/System/Win32/Compat.hs 2021-11-23 21:48:27.000000000 +0100 +++ new/ansi-terminal-0.11.3/src/System/Win32/Compat.hs 2022-04-29 01:00:01.000000000 +0200 @@ -40,8 +40,14 @@ TCHAR, UINT, WORD, failIfFalse_, getLastError, iNVALID_HANDLE_VALUE, nullHANDLE, withTString) +-- Circumstancees in which the patching of Win32 package for the Windows I/O +-- Manager is required +#if defined(__IO_MANAGER_WINIO__)&&MIN_VERSION_Win32(2,9,0)&&!MIN_VERSION_Win32(2,13,2) +#define PATCHING_WIN32_PACKAGE_FOR_WINIO +#endif + -- Circumstances in which the patching of Win32 package is required -#if !MIN_VERSION_Win32(2,5,1)||(defined(__IO_MANAGER_WINIO__)&&!MIN_VERSION_Win32(2,13,2)) +#if !MIN_VERSION_Win32(2,5,1)||defined(PATCHING_WIN32_PACKAGE_FOR_WINIO) #define PATCHING_WIN32_PACKAGE #endif @@ -57,7 +63,7 @@ import Foreign.StablePtr (StablePtr, freeStablePtr, newStablePtr) import GHC.IO.Handle.Types (Handle (..), Handle__ (..)) -#if defined(__IO_MANAGER_WINIO__)&&!MIN_VERSION_Win32(2,13,2) +#if defined(PATCHING_WIN32_PACKAGE_FOR_WINIO) import GHC.IO.Exception (IOErrorType (InappropriateType), IOException (IOError), ioException) import GHC.IO.SubSystem ((<!>)) @@ -87,7 +93,7 @@ withStablePtr :: a -> (StablePtr a -> IO b) -> IO b withStablePtr value = bracket (newStablePtr value) freeStablePtr -#if defined(__IO_MANAGER_WINIO__)&&!MIN_VERSION_Win32(2,13,2) +#if defined(PATCHING_WIN32_PACKAGE_FOR_WINIO) withHandleToHANDLE :: Handle -> (HANDLE -> IO a) -> IO a withHandleToHANDLE = withHandleToHANDLEPosix <!> withHandleToHANDLENative @@ -162,7 +168,7 @@ foreign import WINDOWS_CCONV unsafe "_get_osfhandle" cget_osfhandle :: CInt -> IO HANDLE --- defined(__IO_MANAGER_WINIO__)&&!MIN_VERSION_Win32(2,13,2) +-- defined(PATCHING_WIN32_PACKAGE_FOR_WINIO) #endif -- defined(PATCHING_WIN32_PACKAGE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/src/includes/Common-Include.hs new/ansi-terminal-0.11.3/src/includes/Common-Include.hs --- old/ansi-terminal-0.11.1/src/includes/Common-Include.hs 2021-11-23 21:48:28.000000000 +0100 +++ new/ansi-terminal-0.11.3/src/includes/Common-Include.hs 2022-04-29 01:00:01.000000000 +0200 @@ -1,7 +1,7 @@ -- This file contains code that is common to modules System.Console.ANSI.Unix, -- System.Console.ANSI.Windows and System.Console.ANSI.Windows.Emulator, such as -- type signatures and the definition of functions specific to stdout in terms --- of the corresponding more general functions, inclduding the related Haddock +-- of the corresponding more general functions, including the related Haddock -- documentation. #if !MIN_VERSION_base(4,8,0) @@ -103,12 +103,82 @@ hideCursor = hHideCursor stdout showCursor = hShowCursor stdout --- | Set the terminal window title +-- | Introduce a hyperlink with (key, value) parameters. Some terminals support +-- an @id@ parameter key, so that hyperlinks with the same @id@ value are +-- treated as connected. +-- +-- @since 0.11.3 +hHyperlinkWithParams + :: Handle + -> [(String, String)] -- ^ Parameters + -> String -- ^ URI + -> String -- ^ Link text + -> IO () + +-- | Introduce a hyperlink with (key, value) parameters. Some terminals support +-- an @id@ parameter key, so that hyperlinks with the same @id@ value are +-- treated as connected. +-- +-- @since 0.11.3 +hyperlinkWithParams + :: [(String, String)] -- ^ Parameters + -> String -- ^ URI + -> String -- ^ Link text + -> IO () +hyperlinkWithParams = hHyperlinkWithParams stdout + +-- | Introduce a hyperlink. +-- +-- @since 0.11.3 +hHyperlink + :: Handle + -> String -- ^ URI + -> String -- ^ Link text + -> IO () +hHyperlink h = hHyperlinkWithParams h [] + +-- | Introduce a hyperlink. +-- +-- @since 0.11.3 +hyperlink + :: String -- ^ URI + -> String -- ^ Link text + -> IO () +hyperlink = hHyperlink stdout + +-- | Introduce a hyperlink with an identifier for the link. Some terminals +-- support an identifier, so that hyperlinks with the same identifier are +-- treated as connected. +-- +-- @since 0.11.3 +hHyperlinkWithId + :: Handle + -> String -- ^ Identifier for the link + -> String -- ^ URI + -> String -- ^ Link text + -> IO () +hHyperlinkWithId h linkId = hHyperlinkWithParams h [("id", linkId)] + +-- | Introduce a hyperlink with an identifier for the link. Some terminals +-- support an identifier, so that hyperlinks with the same identifier are +-- treated as connected. +-- +-- @since 0.11.3 +hyperlinkWithId + :: String -- ^ Identifier for the link + -> String -- ^ URI + -> String -- ^ Link text + -> IO () +hyperlinkWithId = hHyperlinkWithId stdout + +-- | Set the terminal window title and icon name (that is, the text for the +-- window in the Start bar, or similar). hSetTitle :: Handle - -> String -- ^ New title + -> String -- ^ New window title and icon name -> IO () --- | Set the terminal window title -setTitle :: String -- ^ New title +-- | Set the terminal window title and icon name (that is, the text for the +-- window in the Start bar, or similar). +setTitle :: String -- ^ New window title and icon name -> IO () setTitle = hSetTitle stdout @@ -161,7 +231,7 @@ -- On Windows, what is returned will depend on what the handle is connected to -- and the version of the operating system. If the handle is identified as -- connected to a \'mintty\' terminal, @return (Just True)@ is --- returned. If it is identifed as connected to a native terminal, then, on +-- returned. If it is identified as connected to a native terminal, then, on -- Windows 10, the processing of \'ANSI\' control characters will be enabled and -- @return (Just True)@ returned; and, on versions of Windows before Windows 10, -- @return (Just False)@ is returned. Otherwise, if a @TERM@ environment diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansi-terminal-0.11.1/src/includes/Exports-Include.hs new/ansi-terminal-0.11.3/src/includes/Exports-Include.hs --- old/ansi-terminal-0.11.1/src/includes/Exports-Include.hs 2021-11-23 21:48:28.000000000 +0100 +++ new/ansi-terminal-0.11.3/src/includes/Exports-Include.hs 2022-04-29 01:00:01.000000000 +0200 @@ -100,6 +100,20 @@ , hideCursorCode , showCursorCode + -- * Hyperlinks + -- | Some, but not all, terminals support hyperlinks - that is, clickable + -- text that points to a URI. On Windows, if emulation is required, + -- hyperlinks are not emulated. + , hyperlink + , hHyperlink + , hyperlinkCode + , hyperlinkWithId + , hHyperlinkWithId + , hyperlinkWithIdCode + , hyperlinkWithParams + , hHyperlinkWithParams + , hyperlinkWithParamsCode + -- * Changing the title , setTitle , hSetTitle