@@ -122,6 +122,11 @@ convertWithOpts opts = do
122 CRLF -> IO.CRLF
122 CRLF -> IO.CRLF
123 LF -> IO.LF
123 LF -> IO.LF
124 Native -> nativeNewline
124 Native -> nativeNewline
128+ istty <- liftIO $ queryTerminal stdOutput
126 runIO' $ do
131 runIO' $ do
127 setUserDataDir datadir
132 setUserDataDir datadir
@@ -178,11 +183,6 @@ convertWithOpts opts = do
178 -- force this with '-o -'. On posix systems, we detect
183 -- force this with '-o -'. On posix systems, we detect
179 -- when stdout is being piped and allow output to stdout
184 -- when stdout is being piped and allow output to stdout
180 -- in that case, but on Windows we can't.
185 -- in that case, but on Windows we can't.
184− istty <- liftIO $ queryTerminal stdOutput
186 when (not (isTextFormat format) && istty && isNothing ( optOutputFile opts)) $
186 when (not (isTextFormat format) && istty && isNothing ( optOutputFile opts)) $
187 throwError $ PandocAppError $
187 throwError $ PandocAppError $
188 "Cannot write " ++ format ++ " output to terminal.\n" ++
188 "Cannot write " ++ format ++ " output to terminal.\n" ++