mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-08 01:10:23 +00:00
[termdesc] send XTVERSION as our very first query to better race ConPTY #2248
This commit is contained in:
parent
41ef5e4790
commit
9507052606
@ -352,7 +352,6 @@ init_terminfo_esc(tinfo* ti, const char* name, escape_e idx,
|
||||
// terminal to which we are talking. if we already know what we're talking
|
||||
// to, there's no point in sending them.
|
||||
#define IDQUERIES TRIDEVATTR \
|
||||
XTVERSION \
|
||||
XTGETTCAP \
|
||||
SECDEVATTR
|
||||
|
||||
@ -415,9 +414,11 @@ init_terminfo_esc(tinfo* ti, const char* name, escape_e idx,
|
||||
// maybe that works, maybe it doesn't. then query both color registers
|
||||
// and geometry. send XTGETTCAP for terminal name. if 'minimal' is set, don't
|
||||
// send any identification queries (we've already identified the terminal).
|
||||
// write DSRCPR as early as possible, so that it precedes any query material
|
||||
// that's bled onto stdin and echoed. if 'noaltscreen' is set, do not send
|
||||
// an smcup. if 'draininput' is set, do not send any keyboard modifiers.
|
||||
// write DSRCPR as early as possible following SMCUP, so that it precedes any
|
||||
// query material that's bled onto stdin and echoed. if 'noaltscreen' is set,
|
||||
// do not send an smcup. if 'draininput' is set, do not send any keyboard
|
||||
// modifiers. sent XTVERSION first of all, since ConPTY passes that through to
|
||||
// the real terminal, and thus it takes a bit longer to get the response.
|
||||
static int
|
||||
send_initial_queries(int fd, unsigned minimal, unsigned noaltscreen,
|
||||
unsigned draininput){
|
||||
@ -431,9 +432,9 @@ send_initial_queries(int fd, unsigned minimal, unsigned noaltscreen,
|
||||
}
|
||||
}else{
|
||||
if(draininput){
|
||||
queries = DSRCPR IDQUERIES DIRECTIVES;
|
||||
queries = XTVERSION DSRCPR IDQUERIES DIRECTIVES;
|
||||
}else{
|
||||
queries = DSRCPR KKBDENTER IDQUERIES DIRECTIVES;
|
||||
queries = XTVERSION DSRCPR IDQUERIES KKBDENTER DIRECTIVES;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
@ -445,9 +446,9 @@ send_initial_queries(int fd, unsigned minimal, unsigned noaltscreen,
|
||||
}
|
||||
}else{
|
||||
if(draininput){
|
||||
queries = SMCUP DSRCPR IDQUERIES DIRECTIVES;
|
||||
queries = XTVERSION SMCUP DSRCPR IDQUERIES DIRECTIVES;
|
||||
}else{
|
||||
queries = SMCUP DSRCPR KKBDENTER IDQUERIES DIRECTIVES;
|
||||
queries = XTVERSION SMCUP DSRCPR IDQUERIES KKBDENTER DIRECTIVES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user