[termdesc] identify Konsole by TDA of ~KDE #2556

dankamongmen/unibilium
nick black 2 years ago
parent 2e21dad75a
commit bdd33e8424
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -1300,7 +1300,7 @@ da2_cb(inputctx* ictx){
// weird form of Ternary Device Attributes used only by WezTerm
static int
da3_cb(inputctx* ictx){
wezterm_tda_cb(inputctx* ictx){
if(ictx->initdata){
loginfo("read ternary device attributes");
}
@ -1666,6 +1666,8 @@ tda_cb(inputctx* ictx){
ictx->initdata->qterm = TERMINAL_TERMINOLOGY;
}else if(strcmp(str, "464F4F54") == 0){ // "FOOT"
ictx->initdata->qterm = TERMINAL_FOOT;
}else if(strcmp(str, "7E4B4445") == 0){
ictx->initdata->qterm = TERMINAL_KONSOLE;
}
loginfo("got TDA: %s, terminal type %d", str, ictx->initdata->qterm);
}
@ -1745,7 +1747,7 @@ build_cflow_automaton(inputctx* ictx){
{ "[?2;0;\\N;\\NS", xtsmgraphics_sixel_cb, },
{ "[>83;\\N;0c", da2_screen_cb, },
{ "[>\\N;\\N;\\Nc", da2_cb, },
{ "[=\\Sc", da3_cb, }, // CSI da3 form as issued by WezTerm
{ "[=\\Sc", wezterm_tda_cb, }, // CSI da3 form as issued by WezTerm
// DCS (\eP...ST)
{ "P0+\\S", NULL, }, // negative XTGETTCAP
{ "P1+r\\S", tcap_cb, }, // positive XTGETTCAP

@ -51,6 +51,7 @@ typedef enum {
TERMINAL_RXVT, // rxvt/urxvt, determined by TERM + UNIX
TERMINAL_MSTERMINAL, // Microsoft Windows Terminal
TERMINAL_MINTTY, // XTVERSION == 'mintty ver' MinTTY (Cygwin, MSYS2)
TERMINAL_KONSOLE, // TDA: "~KDE" (7e4b4445)
} queried_terminals_e;
// after spawning the input layer, send initial queries to the terminal. its

@ -848,11 +848,18 @@ apply_rxvt_heuristics(tinfo* ti){
static const char*
apply_terminology_heuristics(tinfo* ti){
ti->caps.rgb = false; // as of at least 1.9.0
// no RGB as of at least 1.9.0
ti->caps.quadrants = true;
return "Terminology";
}
static const char*
apply_konsole_heuristics(tinfo* ti){
ti->caps.rgb = true;
ti->caps.quadrants = true;
return "Konsole";
}
static const char*
apply_linux_heuristics(tinfo* ti, unsigned nonewfonts){
const char* tname = NULL;
@ -958,6 +965,9 @@ apply_term_heuristics(tinfo* ti, const char* tname, queried_terminals_e qterm,
case TERMINAL_TERMINOLOGY:
newname = apply_terminology_heuristics(ti);
break;
case TERMINAL_KONSOLE:
newname = apply_konsole_heuristics(ti);
break;
default:
newname = tname;
break;

Loading…
Cancel
Save