[windows] detect mintty based off TERM_PROGRAM #2248

pull/2447/head
nick black 3 years ago
parent 98094af341
commit c295aa55c7
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -89,6 +89,21 @@ int prepare_windows_terminal(tinfo* ti, size_t* tablelen, size_t* tableused){
return -1;
}
loginfo("verified Windows ConPTY\n");
// ConPTY intercepts most control sequences. It does pass through XTVERSION
// (for now), but since it responds to the DA1 itself, we usually get that
// prior to any XTVERSION response. We instead key off of mintty's pretty
// reliable use of TERM_PROGRAM and TERM_PROGRAM_VERSION.
const char* tp = getenv("TERM_PROGRAM");
if(tp){
if(strcmp(tp, "mintty") == 0){
const char* ver = getenv("TERM_PROGRAM_VERSION");
if(ver){
ti->version = strdup(ver);
}
loginfo("detected mintty %s\n", ti->version ? ti->version : "");
return TERMINAL_MINTTY;
}
}
ti->qterm = TERMINAL_MSTERMINAL;
return 0;
}

Loading…
Cancel
Save