summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBodigrim <andrew.lelechenko@gmail.com>2022-05-27 21:09:33 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2022-06-15 17:28:50 +0100
commitcbed7afa71fe73196b6ea333ca57895adc055e4b (patch)
treea0131a0a9fb24ff1f85d0804253154adbb3f9614
parent7ed8daa2cc25ceb4ba2ff0571b979899091f6485 (diff)
downloadhaskell-cbed7afa71fe73196b6ea333ca57895adc055e4b.tar.gz
Expand documentation of hIsTerminalDevice
(cherry picked from commit fbf2f254ec85bd696859f939698edfaef8ff708c)
-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