diff options
author | Tom Smeding <tom@tomsmeding.com> | 2021-05-25 21:45:22 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2021-05-25 21:45:22 +0200 |
commit | 953b23229f38f1b76d130086a213d565f13cdc06 (patch) | |
tree | d59282f7a65fd2dc9ae2f40886930c632595232f /Pretty.hs | |
parent | b03f51f3a363f861f9d5de30ec6a337fec316383 (diff) |
Diffstat (limited to 'Pretty.hs')
-rw-r--r-- | Pretty.hs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3,6 +3,8 @@ module Pretty where import qualified Data.Text.Lazy.Builder as B import Data.Text.Lazy.Builder (Builder) import Data.Text.Lazy (Text) +import System.IO (hIsTerminalDevice, stdout) +import System.IO.Unsafe (unsafePerformIO) class Pretty a where @@ -10,3 +12,6 @@ class Pretty a where pretty :: a -> Text pretty = B.toLazyText . pretty' + +stdoutIsTTY :: Bool +stdoutIsTTY = unsafePerformIO $ hIsTerminalDevice stdout |