You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cygwin (3.0.7 or older) and msys2, isatty() does not return correct value.
Description
In cygwin 3.0.7 or older and msys2, return value of isatty() is not correct. The value returned is almost opposite. It returns 0 for pty and returns 1 when it is piped or redirected to /dev/null or /dev/zero. These results are exact opposite to expected values. The correct case is only when it is redirected to normal file. In this case, isatty() returns 0 as expected.
In cygwin 3.1.0 and later, it returns correct value 1 for pty, however, also returns 1 for pipe, /dev/null and /dev/zero.
The Cause
The rc setting at the bottom of jansi_isatty.c is completly reversed. Moreover, checking FILE_TYPE_CHAR is not enough because GetFileType() returns FILE_TYPE_CHAR for cygwin /dev/null and /dev/zero.
Overview
In cygwin (3.0.7 or older) and msys2, isatty() does not return correct value.
Description
In cygwin 3.0.7 or older and msys2, return value of isatty() is not correct. The value returned is almost opposite. It returns 0 for pty and returns 1 when it is piped or redirected to /dev/null or /dev/zero. These results are exact opposite to expected values. The correct case is only when it is redirected to normal file. In this case, isatty() returns 0 as expected.
In cygwin 3.1.0 and later, it returns correct value 1 for pty, however, also returns 1 for pipe, /dev/null and /dev/zero.
The Cause
The rc setting at the bottom of jansi_isatty.c is completly reversed. Moreover, checking FILE_TYPE_CHAR is not enough because GetFileType() returns FILE_TYPE_CHAR for cygwin /dev/null and /dev/zero.
Patch for this issue
The text was updated successfully, but these errors were encountered: