restore termios settings before calling rmcup

This commit is contained in:
nick black 2021-09-05 20:22:44 -04:00
parent a299c3226d
commit cb039eafdf
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -98,6 +98,9 @@ notcurses_stop_minimal(void* vnc){
}
}
if(nc->tcache.ttyfd >= 0){
if(nc->tcache.tpreserved){
ret |= tcsetattr(nc->tcache.ttyfd, TCSAFLUSH, nc->tcache.tpreserved);
}
if((esc = get_escape(&nc->tcache, ESCAPE_RMCUP))){
if(sprite_clear_all(&nc->tcache, f)){
ret = -1;
@ -106,9 +109,6 @@ notcurses_stop_minimal(void* vnc){
ret = -1;
}
}
if(nc->tcache.tpreserved){
ret |= tcsetattr(nc->tcache.ttyfd, TCSAFLUSH, nc->tcache.tpreserved);
}
}
if((esc = get_escape(&nc->tcache, ESCAPE_RMKX)) && fbuf_emit(f, esc)){
ret = -1;