interrogate_terminfo: set utf8 bit

pull/1355/head
nick black 3 years ago committed by Nick Black
parent 840155cd18
commit 28adef7ed8

@ -672,10 +672,9 @@ ncdirect* ncdirect_core_init(const char* termtype, FILE* outfp, uint64_t flags){
if(ncvisual_init(NCLOGLEVEL_SILENT)){
goto err;
}
if(interrogate_terminfo(&ret->tcache, shortname_term)){
if(interrogate_terminfo(&ret->tcache, shortname_term, utf8)){
goto err;
}
ret->tcache.utf8 = utf8;
ncdirect_set_styles(ret, 0);
return ret;

@ -373,7 +373,7 @@ void sigwinch_handler(int signo);
void init_lang(notcurses* nc); // nc may be NULL, only used for logging
int terminfostr(char** gseq, const char* name);
int interrogate_terminfo(tinfo* ti, const char* termname);
int interrogate_terminfo(tinfo* ti, const char* termname, unsigned utf8);
// if there were missing elements we wanted from terminfo, bitch about them here
void warn_terminfo(const notcurses* nc, const tinfo* ti);

@ -69,19 +69,12 @@ apply_term_heuristics(tinfo* ti, const char* termname){
return 0;
}
// there are some capabilities that we want, but can work around. if the
// logging level is set to "warn" or higher, go ahead and complain.
void warn_terminfo(const notcurses* nc, const tinfo* ti){
if(!ti->hpa){
logwarn(nc, "No horizontal position absolute capability");
}
}
// termname is just the TERM environment variable. some details are not
// exposed via terminfo, and we must make heuristic decisions based on
// the detected terminal type, yuck :/.
int interrogate_terminfo(tinfo* ti, const char* termname){
int interrogate_terminfo(tinfo* ti, const char* termname, unsigned utf8){
memset(ti, 0, sizeof(*ti));
ti->utf8 = utf8;
ti->RGBflag = query_rgb();
int colors = tigetnum("colors");
if(colors <= 0){

@ -46,6 +46,9 @@ static int query_address(struct notcurses *nc, struct ncplane *plane,
plane_opts.x = strlen(question) + 1;
struct ncplane *reader_plane = ncplane_create(plane, &plane_opts);
uint64_t channels = 0;
channels_set_bg_alpha(&channels, CELL_ALPHA_TRANSPARENT);
ncplane_set_base(reader_plane, "", 0, channels);
struct ncreader_options reader_opts = {0};
reader_opts.flags = NCREADER_OPTION_CURSOR;

Loading…
Cancel
Save