Skip to content

Commit 00afc5f

Browse files
committed
[notcurses] leave stdin as blocking until init is done
Related to #1609
1 parent f058a8d commit 00afc5f

File tree

1 file changed

+6
-3
lines changed
  • src/third-party/notcurses/src/lib

1 file changed

+6
-3
lines changed

src/third-party/notcurses/src/lib/in.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,7 @@ handoff_initial_responses_late(inputctx* ictx){
12351235
}
12361236
pthread_mutex_unlock(&ictx->ilock);
12371237
if(sig){
1238+
set_fd_nonblocking(ictx->stdinfd, 1, NULL);
12381239
pthread_cond_broadcast(&ictx->icond);
12391240
loginfo("handing off initial responses");
12401241
}
@@ -2030,9 +2031,11 @@ create_inputctx(tinfo* ti, FILE* infp, int lmargin, int tmargin, int rmargin,
20302031
if(getpipes(i->ipipes) == 0){
20312032
memset(&i->amata, 0, sizeof(i->amata));
20322033
if(prep_special_keys(i) == 0){
2033-
if(set_fd_nonblocking(i->stdinfd, 1, &ti->stdio_blocking_save) == 0){
2034-
logdebug("tty_check(%d) = %d",
2035-
i->stdinfd, tty_check(i->stdinfd));
2034+
if(set_fd_nonblocking(i->stdinfd, 0, &ti->stdio_blocking_save) == 0){
2035+
logdebug("tty_check(%d) = %d %d",
2036+
i->stdinfd,
2037+
tty_check(i->stdinfd),
2038+
ti->stdio_blocking_save);
20362039
i->termfd = tty_check(i->stdinfd) ? -1 : get_tty_fd(infp);
20372040
memset(i->initdata, 0, sizeof(*i->initdata));
20382041
if(sent_queries){

0 commit comments

Comments
 (0)