diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-18 00:28:46 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-18 00:28:46 -0400 |
| commit | e6ff8bfc475de337831df1768c6b51eb5f2fb325 (patch) | |
| tree | 9c8f93c3bb3f645616216818106074f3ff51ece3 /src/Propellor/Message.hs | |
| parent | d609e47fca121e127b32dcb24acc5a96ada2c06b (diff) | |
can't rely on TERM; use hIsTerminalDevice
This calls an ioctl, I don't think it's very expensive.
Diffstat (limited to 'src/Propellor/Message.hs')
| -rw-r--r-- | src/Propellor/Message.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Propellor/Message.hs b/src/Propellor/Message.hs index 99e9ba2c..23af5182 100644 --- a/src/Propellor/Message.hs +++ b/src/Propellor/Message.hs @@ -6,7 +6,6 @@ import System.Console.ANSI import System.IO import System.Log.Logger import "mtl" Control.Monad.Reader -import Data.Maybe import Control.Applicative import Propellor.Types @@ -18,7 +17,7 @@ data MessageHandle | TextMessageHandle mkMessageHandle :: IO MessageHandle -mkMessageHandle = ifM (isJust <$> getEnv "TERM") +mkMessageHandle = ifM (hIsTerminalDevice stdout) ( return ConsoleMessageHandle , return TextMessageHandle ) |
