[cbreak_mode] don't tolerate error on GetConsoleMode()

pull/2388/head
nick black 3 years ago
parent bf8aaaff2b
commit e8f210135a
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -1231,14 +1231,11 @@ int cbreak_mode(tinfo* ti){
return -1;
}
#else
// we don't yet have a way to take Cygwin/MSYS2 out of canonical mode. we'll
// hit this stanza in MSYS2; allow the GetConsoleMode() to fail for now. this
// means we'll need enter pressed after the query response, obviously an
// unacceptable state of affairs...FIXME
// we don't yet have a way to take Cygwin/MSYS2 out of canonical mode FIXME.
DWORD mode;
if(!GetConsoleMode(ti->inhandle, &mode)){
logerror("error acquiring input mode\n");
return 0; // FIXME is it safe?
return -1;
}
mode &= ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT);
if(!SetConsoleMode(ti->inhandle, mode)){

Loading…
Cancel
Save