don't call tcgetattr from windows

This commit is contained in:
nick black 2021-08-04 16:58:28 -04:00 committed by nick black
parent bbaa3f4afa
commit 739b6c2dab

View File

@ -695,13 +695,13 @@ int interrogate_terminfo(tinfo* ti, int fd, unsigned utf8, unsigned noaltscreen,
(void)nonewfonts; (void)nonewfonts;
#endif #endif
if(fd >= 0){ if(fd >= 0){
#ifndef __MINGW64__
if(tcgetattr(fd, &ti->tpreserved)){ if(tcgetattr(fd, &ti->tpreserved)){
fprintf(stderr, "Couldn't preserve terminal state for %d (%s)\n", fd, strerror(errno)); fprintf(stderr, "Couldn't preserve terminal state for %d (%s)\n", fd, strerror(errno));
return -1; return -1;
} }
// enter cbreak mode regardless of user preference until we've performed // enter cbreak mode regardless of user preference until we've performed
// terminal interrogation. at that point, we might restore original mode. // terminal interrogation. at that point, we might restore original mode.
#ifndef __MINGW64__
if(cbreak_mode(fd, &ti->tpreserved)){ if(cbreak_mode(fd, &ti->tpreserved)){
return -1; return -1;
} }