guard linux identification in linux tags

dankamongmen/iterm2complete
nick black 3 years ago committed by nick black
parent e9bfb39722
commit b0a4cd622f

@ -669,18 +669,6 @@ int fbcon_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec){
return 0;
}
bool is_linux_console(int fd, unsigned no_font_changes, bool* quadrants){
(void)fd;
(void)no_font_changes;
(void)quadrants;
return false;
}
bool is_linux_framebuffer(tinfo* ti){
(void)ti;
return false;
}
int get_linux_fb_pixelgeom(tinfo* ti, unsigned* ypix, unsigned *xpix){
(void)ti;
(void)ypix;

@ -669,6 +669,7 @@ int interrogate_terminfo(tinfo* ti, int fd, unsigned utf8, unsigned noaltscreen,
#ifdef __APPLE__
qterm = macos_early_matches(tname);
#endif
#ifdef __linux__
ti->linux_fb_fd = -1;
ti->linux_fbuffer = MAP_FAILED;
// we might or might not program quadrants into the console font
@ -678,6 +679,7 @@ int interrogate_terminfo(tinfo* ti, int fd, unsigned utf8, unsigned noaltscreen,
// FIXME set up pixel-drawing API for framebuffer #1369
}
}
#endif
if(fd >= 0){
if(tcgetattr(fd, &ti->tpreserved)){
fprintf(stderr, "Couldn't preserve terminal state for %d (%s)\n", fd, strerror(errno));

@ -186,10 +186,12 @@ typedef struct tinfo {
int default_rows; // LINES environment var / lines terminfo / 24
int default_cols; // COLUMNS environment var / cols terminfo / 80
#ifdef __linux__
int linux_fb_fd; // linux framebuffer device fd
char* linux_fb_dev; // device corresponding to linux_fb_dev
uint8_t* linux_fbuffer; // mmap()ed framebuffer
size_t linux_fb_len; // size of map
#endif
// some terminals (e.g. kmscon) return cursor coordinates inverted from the
// typical order. we detect it the first time ncdirect_cursor_yx() is called.

Loading…
Cancel
Save