]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_win32.cpp
an example for the sweave module, prepared by Gregor Gorjanc
[lyx.git] / src / support / os_win32.cpp
index 464d8df1114e0a20d80363aa47da4d22fc2ebf96..a204adfde094fe5b7b70fd0cbddcb181a863cedc 100644 (file)
@@ -296,28 +296,23 @@ string const & nulldev()
 }
 
 
-string const & stdoutdev()
-{
-       static string const stdoutdev_ = "conout$";
-       return stdoutdev_;
-}
-
-
-string const & stderrdev()
-{
-       static string const stderrdev_ = "conout$";
-       return stderrdev_;
-}
-
-
 bool is_terminal(io_channel channel)
 {
-       // FIXME: Passing conout$ to Qt fails, most probably for the
-       // reason explained here:
-       // http://support.microsoft.com/?scid=kb%3Ben-us%3B90088&x=15&y=15
-       // How to convince Qt to open conout$ in FILE_SHARE_WRITE mode?
-       // For the time being, we assume we are not running in a terminal.
-       return false;
+       switch (channel) {
+       case STDIN:
+               if (GetStdHandle(STD_INPUT_HANDLE) == NULL)
+                       return false;
+               break;
+       case STDOUT:
+               if (GetStdHandle(STD_OUTPUT_HANDLE) == NULL)
+                       return false;
+               break;
+       case STDERR:
+               if (GetStdHandle(STD_ERROR_HANDLE) == NULL)
+                       return false;
+               break;
+       }
+       return true;
 }