disable ECHO and ICANON

pull/7/head
nick black 5 years ago
parent abebd8d18e
commit f88e211c26
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -63,6 +63,7 @@ term_emit(const char* seq){
}
notcurses* notcurses_init(void){
struct termios modtermios;
notcurses* ret = malloc(sizeof(*ret));
if(ret == NULL){
return ret;
@ -74,6 +75,13 @@ notcurses* notcurses_init(void){
free(ret);
return NULL;
}
memcpy(&modtermios, &ret->tpreserved, sizeof(modtermios));
modtermios.c_lflag &= (~ECHO & ~ICANON);
if(tcsetattr(ret->ttyfd, TCSANOW, &modtermios)){
fprintf(stderr, "Error disabling echo / canonical on %d (%s)\n",
ret->ttyfd, strerror(errno));
goto err;
}
int termerr;
if(setupterm(NULL, ret->ttyfd, &termerr) != OK){
fprintf(stderr, "Terminfo error %d (see terminfo(3ncurses))\n", termerr);

Loading…
Cancel
Save