locate_cursor_early: require ttyfd #1880

pull/1867/head
nick black 3 years ago
parent acc66372b5
commit e870e12285
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -794,6 +794,7 @@ int cursor_yx_get(int ttyfd, const char* u7, int* y, int* x){
} }
int locate_cursor_early(struct notcurses* nc, int* cursor_y, int* cursor_x){ int locate_cursor_early(struct notcurses* nc, int* cursor_y, int* cursor_x){
if(nc->ttyfd >= 0){
const char* u7 = get_escape(&nc->tcache, ESCAPE_DSRCPR); const char* u7 = get_escape(&nc->tcache, ESCAPE_DSRCPR);
// FIXME ought check for cursor inversion! // FIXME ought check for cursor inversion!
int ret = cursor_yx_get(nc->ttyfd, u7, cursor_y, cursor_x); int ret = cursor_yx_get(nc->ttyfd, u7, cursor_y, cursor_x);
@ -807,5 +808,6 @@ int locate_cursor_early(struct notcurses* nc, int* cursor_y, int* cursor_x){
--*cursor_y; --*cursor_y;
--*cursor_x; --*cursor_x;
} }
}
return ret; return ret;
} }

Loading…
Cancel
Save