mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-08 01:10:23 +00:00
[cbreak_mode] don't tolerate error on GetConsoleMode()
This commit is contained in:
parent
bf8aaaff2b
commit
e8f210135a
@ -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…
Reference in New Issue
Block a user