summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBodigrim <andrew.lelechenko@gmail.com>2022-05-27 21:09:33 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-28 21:01:58 -0400
commitfbf2f254ec85bd696859f939698edfaef8ff708c (patch)
tree6a121769ce3cf11244c0a30d15de9d7dbd01cbc8
parent6341c8ed5d3689c9cc52f4fcd2dce78a5f75b5a5 (diff)
downloadhaskell-fbf2f254ec85bd696859f939698edfaef8ff708c.tar.gz
Expand documentation of hIsTerminalDevice
-rw-r--r--libraries/base/GHC/IO/Handle.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/libraries/base/GHC/IO/Handle.hs b/libraries/base/GHC/IO/Handle.hs
index 9bfb7df4cb..02242a93f2 100644
--- a/libraries/base/GHC/IO/Handle.hs
+++ b/libraries/base/GHC/IO/Handle.hs
@@ -563,7 +563,14 @@ hGetEcho handle = do
_ -> IODevice.getEcho haDevice
-- | Is the handle connected to a terminal?
-
+--
+-- On Windows the result of 'hIsTerminalDevide' might be misleading,
+-- because non-native terminals, such as MinTTY used in MSYS and Cygwin environments,
+-- are implemented via redirection.
+-- Use @System.Win32.Types.withHandleToHANDLE System.Win32.MinTTY.isMinTTYHandle@
+-- to recognise it. Also consider @ansi-terminal@ package for crossplatform terminal
+-- support.
+--
hIsTerminalDevice :: Handle -> IO Bool
hIsTerminalDevice handle =
withHandle_ "hIsTerminalDevice" handle $ \ Handle__{..} -> do