stop_minimal: use TCSAFLUSH to stop responses from emerging

pull/2122/head
nick black 3 years ago
parent 0a959617c6
commit 2732620821
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -101,7 +101,7 @@ notcurses_stop_minimal(void* vnc){
ret = -1; ret = -1;
} }
} }
ret |= tcsetattr(nc->tcache.ttyfd, TCSANOW, nc->tcache.tpreserved); ret |= tcsetattr(nc->tcache.ttyfd, TCSAFLUSH, nc->tcache.tpreserved);
} }
if((esc = get_escape(&nc->tcache, ESCAPE_RMKX)) && fbuf_emit(f, esc)){ if((esc = get_escape(&nc->tcache, ESCAPE_RMKX)) && fbuf_emit(f, esc)){
ret = -1; ret = -1;
@ -1259,7 +1259,7 @@ err:
logpanic("Alas, you will not be going to space today.\n"); logpanic("Alas, you will not be going to space today.\n");
// FIXME looks like we have some memory leaks on this error path? // FIXME looks like we have some memory leaks on this error path?
fbuf_free(&ret->rstate.f); fbuf_free(&ret->rstate.f);
(void)tcsetattr(ret->tcache.ttyfd, TCSANOW, ret->tcache.tpreserved); (void)tcsetattr(ret->tcache.ttyfd, TCSAFLUSH, ret->tcache.tpreserved);
drop_signals(ret); drop_signals(ret);
del_curterm(cur_term); del_curterm(cur_term);
pthread_mutex_destroy(&ret->stats.lock); pthread_mutex_destroy(&ret->stats.lock);

Loading…
Cancel
Save