Check output device is a terminal: Difference between revisions

m
→‎{{header|Haskell}}: ( applied hindent )
mNo edit summary
m (→‎{{header|Haskell}}: ( applied hindent ))
Line 134:
main = do
istty <- queryTerminal stdOutput
putStrLn (if istty
(if istty
then "stdout is tty"
elsethen "stdout is not tty")
thenelse "stdout is not tty")</lang>
</lang>
{{outOut}}
 
{{out}}
 
<pre>$ runhaskell istty.hs
stdout is tty
9,655

edits