|
|
@ -447,11 +447,14 @@ int ncdirect_cursor_yx(ncdirect* n, int* y, int* x){
|
|
|
|
int tmp = *y;
|
|
|
|
int tmp = *y;
|
|
|
|
*y = *x;
|
|
|
|
*y = *x;
|
|
|
|
*x = tmp;
|
|
|
|
*x = tmp;
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
// we use 0-based coordinates, but known terminals use 1-based coordinates
|
|
|
|
// we use 0-based coordinates, but known terminals use 1-based
|
|
|
|
|
|
|
|
// coordinates. the only known exception is kmscon, which is
|
|
|
|
|
|
|
|
// incidentally the only one which inverts its response.
|
|
|
|
--*y;
|
|
|
|
--*y;
|
|
|
|
--*x;
|
|
|
|
--*x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if(tcsetattr(n->tcache.ttyfd, TCSANOW, &oldtermios)){
|
|
|
|
if(tcsetattr(n->tcache.ttyfd, TCSANOW, &oldtermios)){
|
|
|
|
fprintf(stderr, "Couldn't restore terminal mode on %d (%s)\n",
|
|
|
|
fprintf(stderr, "Couldn't restore terminal mode on %d (%s)\n",
|
|
|
|
n->tcache.ttyfd, strerror(errno)); // don't return error for this
|
|
|
|
n->tcache.ttyfd, strerror(errno)); // don't return error for this
|
|
|
|