From 6d3c8e1add3383f7939ad942f7027848fba44c1f Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 27 Feb 2021 16:02:35 -0500 Subject: [PATCH] ncdirect_init: don't force query_term() --- src/lib/direct.cpp | 3 --- src/lib/notcurses.c | 9 ++++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib/direct.cpp b/src/lib/direct.cpp index e4acd1ef3..370839919 100644 --- a/src/lib/direct.cpp +++ b/src/lib/direct.cpp @@ -696,9 +696,6 @@ ncdirect* ncdirect_core_init(const char* termtype, FILE* outfp, uint64_t flags){ if(interrogate_terminfo(&ret->tcache, shortname_term, utf8)){ goto err; } - if(query_term(&ret->tcache, ret->ctermfd)){ - goto err; - } ncdirect_set_styles(ret, 0); return ret; diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 4439f663d..bfb50089e 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -782,8 +782,7 @@ init_banner(const notcurses* nc){ " terminfo from %s\n", nc->stdplane->leny, nc->stdplane->lenx, bprefix(nc->stats.fbbytes, 1, prefixbuf, 0), sizeof(nccell), - nc->tcache.colors, - nc->tcache.RGBflag ? "+RGB" : "", + nc->tcache.colors, nc->tcache.RGBflag ? "+RGB" : "", __VERSION__, #ifdef __BYTE_ORDER__ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ @@ -1029,6 +1028,9 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){ if(ncinputlayer_init(&ret->input, stdin)){ goto err; } + if(make_nonblocking(ret->input.ttyinfd)){ + goto err; + } // Neither of these is supported on e.g. the "linux" virtual console. if(!(opts->flags & NCOPTION_NO_ALTERNATE_SCREEN)){ terminfostr(&ret->tcache.smcup, "smcup"); @@ -1052,9 +1054,6 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){ } reset_term_attributes(ret); } - if(make_nonblocking(ret->input.ttyinfd)){ - goto err; - } if((ret->rstate.mstreamfp = open_memstream(&ret->rstate.mstream, &ret->rstate.mstrsize)) == NULL){ free_plane(ret->stdplane); goto err;