diff options
Diffstat (limited to 'src/ptycheck/isatty.c')
-rw-r--r-- | src/ptycheck/isatty.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ptycheck/isatty.c b/src/ptycheck/isatty.c new file mode 100644 index 0000000..61acee6 --- /dev/null +++ b/src/ptycheck/isatty.c @@ -0,0 +1,26 @@ +#include <unistd.h> //for isatty()
+#include <stdio.h> //for fileno()
+
+#ifdef __MINGW64__
+#include "iscygpty.h"
+#endif
+
+int c_isatty(void)
+{
+
+ if (isatty(fileno(stdout))){
+ return 1;
+ } else {
+
+ #ifdef __MINGW64__
+ if (is_cygpty(fileno(stdout))){
+ return 1;
+ } else {
+ return 0;
+ }
+ #endif
+
+ return 0;
+ }
+
+}
\ No newline at end of file |