cursor_yx_get: loop on 0 input for GNU screen #1902

dankamongmen/linuxfbdumb
nick black 3 years ago
parent e2a3af49b5
commit a7779c5024
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -1127,9 +1127,6 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
goto err;
}
ret->suppress_banner = opts->flags & NCOPTION_SUPPRESS_BANNERS;
if(set_fd_nonblocking(ret->tcache.input.infd, 1, &ret->stdio_blocking_save)){
goto err;
}
if(ncvisual_init(ret->loglevel)){
goto err;
}
@ -1168,6 +1165,9 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
}
ncplane_cursor_move_yx(ret->stdplane, cursor_y, cursor_x);
}
if(set_fd_nonblocking(ret->tcache.input.infd, 1, &ret->stdio_blocking_save)){
goto err;
}
// flush on the switch to alternate screen, lest initial output be swept away
const char* clearscr = get_escape(&ret->tcache, ESCAPE_CLEAR);
// if not connected to an actual terminal, we're not going to try entering

@ -833,7 +833,8 @@ int cursor_yx_get(int ttyfd, const char* u7, int* y, int* x){
break;
}
}
}while(!done && (r == 1 || (errno == EINTR || errno == EAGAIN || errno == EBUSY)));
// need to loop 0 to handle slow terminals, see for instance screen =[
}while(!done && (r >= 0 || (errno == EINTR || errno == EAGAIN || errno == EBUSY)));
if(!done){
logerror("Error reading cursor location\n");
return -1;

Loading…
Cancel
Save