mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
don't try to use termios from windows
This commit is contained in:
parent
8c217dc6bb
commit
a9d2214414
@ -405,6 +405,7 @@ detect_cursor_inversion_wrapper(ncdirect* n, const char* u7, int* y, int* x){
|
||||
// the terminal, and then reading a response. many things can distupt this
|
||||
// non-atomic procedure, leading to unexpected results. a garbage function.
|
||||
int ncdirect_cursor_yx(ncdirect* n, int* y, int* x){
|
||||
#ifndef __MINGW64__ // FIXME
|
||||
struct termios termio, oldtermios;
|
||||
// this is only meaningful for real terminals
|
||||
if(n->ctermfd < 0){
|
||||
@ -455,6 +456,9 @@ int ncdirect_cursor_yx(ncdirect* n, int* y, int* x){
|
||||
n->ctermfd, strerror(errno)); // don't return error for this
|
||||
}
|
||||
return ret;
|
||||
#else
|
||||
return -1; // FIXME
|
||||
#endif
|
||||
}
|
||||
|
||||
int ncdirect_cursor_push(ncdirect* n){
|
||||
|
@ -18,6 +18,7 @@ void sigwinch_handler(int signo){
|
||||
}
|
||||
|
||||
int cbreak_mode(int ttyfd, const struct termios* tpreserved){
|
||||
#ifndef __MINGW64__
|
||||
if(ttyfd < 0){
|
||||
return 0;
|
||||
}
|
||||
@ -36,11 +37,15 @@ int cbreak_mode(int ttyfd, const struct termios* tpreserved){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return -1; // FIXME
|
||||
#endif
|
||||
}
|
||||
|
||||
// Disable signals originating from the terminal's line discipline, i.e.
|
||||
// SIGINT (^C), SIGQUIT (^\), and SIGTSTP (^Z). They are enabled by default.
|
||||
int notcurses_linesigs_disable(notcurses* n){
|
||||
#ifndef __MINGW64__
|
||||
if(n->ttyfd < 0){
|
||||
return 0;
|
||||
}
|
||||
@ -55,11 +60,15 @@ int notcurses_linesigs_disable(notcurses* n){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return -1; // FIXME
|
||||
#endif
|
||||
}
|
||||
|
||||
// Restore signals originating from the terminal's line discipline, i.e.
|
||||
// SIGINT (^C), SIGQUIT (^\), and SIGTSTP (^Z), if disabled.
|
||||
int notcurses_linesigs_enable(notcurses* n){
|
||||
#ifndef __MINGW64__
|
||||
if(n->ttyfd < 0){
|
||||
return 0;
|
||||
}
|
||||
@ -74,6 +83,9 @@ int notcurses_linesigs_enable(notcurses* n){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return -1; // FIXME
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
@ -880,13 +880,13 @@ int ncplane_destroy_family(ncplane *ncp){
|
||||
// only invoked without suppress banners flag. prints various warnings based on
|
||||
// the environment / terminal definition. returns the number of lines printed.
|
||||
static int
|
||||
init_banner_warnings(const notcurses* nc, FILE* out){
|
||||
term_fg_palindex(nc, out, nc->tcache.caps.colors <= 88 ? 1 : 0xcb);
|
||||
init_banner_warnings(const notcurses* nc, fbuf* f){
|
||||
term_fg_palindex(nc, f, nc->tcache.caps.colors <= 88 ? 1 : 0xcb);
|
||||
if(!notcurses_canutf8(nc)){
|
||||
fprintf(out, " Warning! Encoding is not UTF-8; output may be degraded.\n");
|
||||
fbuf_puts(f, " Warning! Encoding is not UTF-8; output may be degraded.\n");
|
||||
}
|
||||
if(!get_escape(&nc->tcache, ESCAPE_HPA)){
|
||||
fprintf(out, " Warning! No absolute horizontal placement.\n");
|
||||
fbuf_puts(f, " Warning! No absolute horizontal placement.\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -695,6 +695,7 @@ int interrogate_terminfo(tinfo* ti, int fd, unsigned utf8, unsigned noaltscreen,
|
||||
}
|
||||
// enter cbreak mode regardless of user preference until we've performed
|
||||
// terminal interrogation. at that point, we might restore original mode.
|
||||
#ifndef __MINGW64__
|
||||
if(cbreak_mode(fd, &ti->tpreserved)){
|
||||
return -1;
|
||||
}
|
||||
@ -705,6 +706,7 @@ int interrogate_terminfo(tinfo* ti, int fd, unsigned utf8, unsigned noaltscreen,
|
||||
fprintf(stderr, "Error issuing terminal queries on %d\n", fd);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
ti->sprixel_scale_height = 1;
|
||||
get_default_geometry(ti);
|
||||
|
@ -180,7 +180,9 @@ typedef struct tinfo {
|
||||
int sprixel_scale_height; // sprixel must be a multiple of this many rows
|
||||
const char* termname; // terminal name from environment variables/init
|
||||
char* termversion; // terminal version (freeform) from query responses
|
||||
#ifndef __MINGW64__
|
||||
struct termios tpreserved;// terminal state upon entry
|
||||
#endif
|
||||
ncinputlayer input; // input layer
|
||||
|
||||
int default_rows; // LINES environment var / lines terminfo / 24
|
||||
|
Loading…
Reference in New Issue
Block a user