stop pushing termtype to interrogate_terminfo

pull/2280/head
nick black 3 years ago
parent ec67847806
commit 4fc1b4493f
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -911,7 +911,7 @@ ncdirect* ncdirect_core_init(const char* termtype, FILE* outfp, uint64_t flags){
}
int cursor_y = -1;
int cursor_x = -1;
if(interrogate_terminfo(&ret->tcache, termtype, ret->ttyfp, utf8, 1,
if(interrogate_terminfo(&ret->tcache, ret->ttyfp, utf8, 1,
flags & NCDIRECT_OPTION_INHIBIT_CBREAK,
0, &cursor_y, &cursor_x, &ret->stats, 0, 0, 0, 0,
flags & NCDIRECT_OPTION_DRAIN_INPUT)){

@ -1079,7 +1079,7 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
&ret->rstate.logendy : &fakecursory;
int* cursorx = opts->flags & NCOPTION_PRESERVE_CURSOR ?
&ret->rstate.logendx : &fakecursorx;
if(interrogate_terminfo(&ret->tcache, opts->termtype, ret->ttyfp, utf8,
if(interrogate_terminfo(&ret->tcache, ret->ttyfp, utf8,
opts->flags & NCOPTION_NO_ALTERNATE_SCREEN, 0,
opts->flags & NCOPTION_NO_FONT_CHANGES,
cursory, cursorx, &ret->stats,

@ -769,11 +769,12 @@ macos_early_matches(void){
// Device Attributes, allowing us to get a negative response if our queries
// aren't supported by the terminal. we fire it off early because we have a
// full round trip before getting the reply, which is likely to pace init.
int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out, unsigned utf8,
int interrogate_terminfo(tinfo* ti, FILE* out, unsigned utf8,
unsigned noaltscreen, unsigned nocbreak, unsigned nonewfonts,
int* cursor_y, int* cursor_x, ncsharedstats* stats,
int lmargin, int tmargin, int rmargin, int bmargin,
unsigned draininput){
const char* termtype = getenv("TERM");
int foolcursor_x, foolcursor_y;
if(!cursor_x){
cursor_x = &foolcursor_x;

@ -222,15 +222,13 @@ term_supported_styles(const tinfo* ti){
// prepare |ti| from the terminfo database and other sources. set |utf8| if
// we've verified UTF8 output encoding. set |noaltscreen| to inhibit alternate
// screen detection. |stats| may be NULL; either way, it will be handed to the
// input layer so that its stats can be recorded. if |termtype| is not NULL, it
// will be used to look up the terminfo database entry; the value of TERM is
// otherwise used.
int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out,
unsigned utf8, unsigned noaltscreen, unsigned nocbreak,
// input layer so that its stats can be recorded.
int interrogate_terminfo(tinfo* ti, FILE* out, unsigned utf8,
unsigned noaltscreen, unsigned nocbreak,
unsigned nonewfonts, int* cursor_y, int* cursor_x,
struct ncsharedstats* stats, int lmargin, int tmargin,
int rmargin, int bmargin, unsigned draininput)
__attribute__ ((nonnull (1, 3, 10)));
__attribute__ ((nonnull (1, 2, 9)));
void free_terminfo_cache(tinfo* ti);

Loading…
Cancel
Save