kill FIXME: detect whether linesigs are enabled on startup

This commit is contained in:
nick black 2021-09-26 00:11:33 -04:00
parent 58f650f0c1
commit 4da93eae5d
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
3 changed files with 17 additions and 9 deletions

View File

@ -436,7 +436,8 @@ prep_special_keys(inputctx* ictx){
static inline inputctx*
create_inputctx(tinfo* ti, FILE* infp, int lmargin, int tmargin,
ncsharedstats* stats, unsigned drain){
ncsharedstats* stats, unsigned drain,
int linesigs_enabled){
inputctx* i = malloc(sizeof(*i));
if(i){
i->csize = 64;
@ -465,9 +466,7 @@ create_inputctx(tinfo* ti, FILE* infp, int lmargin, int tmargin,
i->stdinhandle = ti->inhandle;
#endif
i->ibufvalid = 0;
// FIXME need to get this out of the initial termios
// (as stored in tpreserved)
i->linesigs = 1;
i->linesigs = linesigs_enabled;
i->tbufvalid = 0;
i->midescape = 0;
i->numeric = 0;
@ -1962,8 +1961,10 @@ input_thread(void* vmarshall){
}
int init_inputlayer(tinfo* ti, FILE* infp, int lmargin, int tmargin,
ncsharedstats* stats, unsigned drain){
inputctx* ictx = create_inputctx(ti, infp, lmargin, tmargin, stats, drain);
ncsharedstats* stats, unsigned drain,
int linesigs_enabled){
inputctx* ictx = create_inputctx(ti, infp, lmargin, tmargin, stats, drain,
linesigs_enabled);
if(ictx == NULL){
return -1;
}

View File

@ -14,7 +14,8 @@ struct inputctx;
struct ncsharedstats;
int init_inputlayer(struct tinfo* ti, FILE* infp, int lmargin, int tmargin,
struct ncsharedstats* stats, unsigned drain)
struct ncsharedstats* stats, unsigned drain,
int linesigs_enabled)
__attribute__ ((nonnull (1, 2, 5)));
int stop_inputlayer(struct tinfo* ti);

View File

@ -780,7 +780,6 @@ int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out, unsigned ut
free(ti->tpreserved);
return -1;
}
// FIXME need to enter alternate screen here
// if we already know our terminal (e.g. on the linux console), there's no
// need to send the identification queries. the controls are sufficient.
bool minimal = (ti->qterm != TERMINAL_UNKNOWN);
@ -799,7 +798,14 @@ int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out, unsigned ut
}
tname = termname(); // longname() is also available
#endif
if(init_inputlayer(ti, stdin, lmargin, tmargin, stats, draininput)){
int linesigs_enabled = 1;
if(ti->tpreserved){
if(!(ti->tpreserved->c_lflag & ISIG)){
linesigs_enabled = 0;
}
}
if(init_inputlayer(ti, stdin, lmargin, tmargin, stats, draininput,
linesigs_enabled)){
goto err;
}
ti->sprixel_scale_height = 1;