@@ -122,6 +122,11 @@ convertWithOpts opts = do
122122 CRLF -> IO.CRLF
123123 LF -> IO.LF
124124 Native -> nativeNewline
125+#ifdef _WINDOWS
126+ let istty = True
127+#else
128+ istty <- liftIO $ queryTerminal stdOutput
129+#endif
125130
126131 runIO' $ do
127132 setUserDataDir datadir
@@ -178,11 +183,6 @@ convertWithOpts opts = do
178183 -- force this with '-o -'. On posix systems, we detect
179184 -- when stdout is being piped and allow output to stdout
180185 -- in that case, but on Windows we can't.
181−#ifdef _WINDOWS
182− let istty = True
183−#else
184− istty <- liftIO $ queryTerminal stdOutput
185−#endif
186186 when (not (isTextFormat format) && istty && isNothing ( optOutputFile opts)) $
187187 throwError $ PandocAppError $
188188 "Cannot write " ++ format ++ " output to terminal.\n" ++