ncinputlayer_init: prep for terminal detection end sequene

pull/1764/head
nick black 3 years ago committed by Nick Black
parent 935e982487
commit a22e941b5e

@ -616,7 +616,8 @@ void ncinputlayer_stop(ncinputlayer* nilayer){
input_free_esctrie(&nilayer->inputescapes);
}
int ncinputlayer_init(ncinputlayer* nilayer, FILE* infp){
int ncinputlayer_init(tinfo* tcache, FILE* infp){
ncinputlayer* nilayer = &tcache->input;
setbuffer(infp, NULL, 0);
nilayer->inputescapes = NULL;
nilayer->infd = fileno(infp);
@ -628,5 +629,8 @@ int ncinputlayer_init(ncinputlayer* nilayer, FILE* infp){
nilayer->inputbuf_valid_starts = 0;
nilayer->inputbuf_write_at = 0;
nilayer->input_events = 0;
if(nilayer->ttyfd >= 0){
// FIXME complete terminal detection
}
return 0;
}

@ -1493,7 +1493,12 @@ cellcmp_and_dupfar(egcpool* dampool, nccell* damcell,
return 1;
}
int ncinputlayer_init(ncinputlayer* nilayer, FILE* infp);
// sets up the input layer, building a trie of escape sequences and their
// nckey equivalents. if we are connected to a tty, this also completes the
// terminal detection sequence (we ought have already written our initial
// queries, ideally as early as possible).
int ncinputlayer_init(tinfo* tcache, FILE* infp);
void ncinputlayer_stop(ncinputlayer* nilayer);
// FIXME absorb into ncinputlayer_init()

@ -421,7 +421,7 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname, unsigned utf8,
goto err;
}
}
if(ncinputlayer_init(&ti->input, stdin)){
if(ncinputlayer_init(ti, stdin)){
return -1;
}
if(apply_term_heuristics(ti, termname, fd)){

Loading…
Cancel
Save