@@ -742,6 +742,8 @@ getReportedCursorPosition = Internal.getReportedCursorPosition
742
742
-- as mintty, that are not based on the Windows' Console API. (Command Prompt
743
743
-- and PowerShell are based on the Console API.)
744
744
--
745
+ -- This operation may fail with an error if 'stdin' has been redirected.
746
+ --
745
747
-- @since 0.10.3
746
748
getCursorPosition :: IO (Maybe (Int , Int ))
747
749
getCursorPosition = hGetCursorPosition stdout
@@ -760,6 +762,8 @@ getCursorPosition = hGetCursorPosition stdout
760
762
-- as mintty, that are not based on the Windows' Console API. (Command Prompt
761
763
-- and PowerShell are based on the Console API.)
762
764
--
765
+ -- This operation may fail with an error if 'stdin' has been redirected.
766
+ --
763
767
-- @since 0.10.1
764
768
hGetCursorPosition :: Handle -> IO (Maybe (Int , Int ))
765
769
hGetCursorPosition h = fmap to0base <$> getCursorPosition'
@@ -864,6 +868,8 @@ getReportedLayerColor = Internal.getReportedLayerColor
864
868
--
865
869
-- Underlining is not supported.
866
870
--
871
+ -- This operation may fail with an error if 'stdin' has been redirected.
872
+ --
867
873
-- @since 0.11.4
868
874
getLayerColor :: ConsoleLayer -> IO (Maybe (RGB Word16 ))
869
875
getLayerColor = hGetLayerColor stdout
@@ -882,6 +888,8 @@ getLayerColor = hGetLayerColor stdout
882
888
--
883
889
-- Underlining is not supported.
884
890
--
891
+ -- This operation may fail with an error if 'stdin' has been redirected.
892
+ --
885
893
-- @since 0.11.4
886
894
hGetLayerColor :: Handle -> ConsoleLayer -> IO (Maybe (RGB Word16 ))
887
895
hGetLayerColor h layer = do
@@ -976,6 +984,8 @@ layerColor layer = do
976
984
-- as mintty, that are not based on Windows' Console API. (Command Prompt and
977
985
-- PowerShell are based on the Console API.)
978
986
--
987
+ -- This operation may fail with an error if 'stdin' has been redirected.
988
+ --
979
989
-- For a different approach, one that does not use control character sequences
980
990
-- and works when 'stdin' is redirected, see the
981
991
-- <https://hackage.haskell.org/package/terminal-size terminal-size> package.
@@ -999,6 +1009,8 @@ getTerminalSize = hGetTerminalSize stdout
999
1009
-- as mintty, that are not based on the Windows' Console API. (Command Prompt
1000
1010
-- and PowerShell are based on the Console API.)
1001
1011
--
1012
+ -- This operation may fail with an error if 'stdin' has been redirected.
1013
+ --
1002
1014
-- For a different approach, one that does not use control character sequences
1003
1015
-- and works when 'stdin' is redirected, see the
1004
1016
-- <https://hackage.haskell.org/package/terminal-size terminal-size> package.
0 commit comments