mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
[termdesc] identify Konsole by TDA of ~KDE #2556
This commit is contained in:
parent
2e21dad75a
commit
bdd33e8424
@ -1300,7 +1300,7 @@ da2_cb(inputctx* ictx){
|
|||||||
|
|
||||||
// weird form of Ternary Device Attributes used only by WezTerm
|
// weird form of Ternary Device Attributes used only by WezTerm
|
||||||
static int
|
static int
|
||||||
da3_cb(inputctx* ictx){
|
wezterm_tda_cb(inputctx* ictx){
|
||||||
if(ictx->initdata){
|
if(ictx->initdata){
|
||||||
loginfo("read ternary device attributes");
|
loginfo("read ternary device attributes");
|
||||||
}
|
}
|
||||||
@ -1666,6 +1666,8 @@ tda_cb(inputctx* ictx){
|
|||||||
ictx->initdata->qterm = TERMINAL_TERMINOLOGY;
|
ictx->initdata->qterm = TERMINAL_TERMINOLOGY;
|
||||||
}else if(strcmp(str, "464F4F54") == 0){ // "FOOT"
|
}else if(strcmp(str, "464F4F54") == 0){ // "FOOT"
|
||||||
ictx->initdata->qterm = TERMINAL_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);
|
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, },
|
{ "[?2;0;\\N;\\NS", xtsmgraphics_sixel_cb, },
|
||||||
{ "[>83;\\N;0c", da2_screen_cb, },
|
{ "[>83;\\N;0c", da2_screen_cb, },
|
||||||
{ "[>\\N;\\N;\\Nc", da2_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)
|
// DCS (\eP...ST)
|
||||||
{ "P0+\\S", NULL, }, // negative XTGETTCAP
|
{ "P0+\\S", NULL, }, // negative XTGETTCAP
|
||||||
{ "P1+r\\S", tcap_cb, }, // positive XTGETTCAP
|
{ "P1+r\\S", tcap_cb, }, // positive XTGETTCAP
|
||||||
|
@ -51,6 +51,7 @@ typedef enum {
|
|||||||
TERMINAL_RXVT, // rxvt/urxvt, determined by TERM + UNIX
|
TERMINAL_RXVT, // rxvt/urxvt, determined by TERM + UNIX
|
||||||
TERMINAL_MSTERMINAL, // Microsoft Windows Terminal
|
TERMINAL_MSTERMINAL, // Microsoft Windows Terminal
|
||||||
TERMINAL_MINTTY, // XTVERSION == 'mintty ver' MinTTY (Cygwin, MSYS2)
|
TERMINAL_MINTTY, // XTVERSION == 'mintty ver' MinTTY (Cygwin, MSYS2)
|
||||||
|
TERMINAL_KONSOLE, // TDA: "~KDE" (7e4b4445)
|
||||||
} queried_terminals_e;
|
} queried_terminals_e;
|
||||||
|
|
||||||
// after spawning the input layer, send initial queries to the terminal. its
|
// after spawning the input layer, send initial queries to the terminal. its
|
||||||
|
@ -848,11 +848,18 @@ apply_rxvt_heuristics(tinfo* ti){
|
|||||||
|
|
||||||
static const char*
|
static const char*
|
||||||
apply_terminology_heuristics(tinfo* ti){
|
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;
|
ti->caps.quadrants = true;
|
||||||
return "Terminology";
|
return "Terminology";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char*
|
||||||
|
apply_konsole_heuristics(tinfo* ti){
|
||||||
|
ti->caps.rgb = true;
|
||||||
|
ti->caps.quadrants = true;
|
||||||
|
return "Konsole";
|
||||||
|
}
|
||||||
|
|
||||||
static const char*
|
static const char*
|
||||||
apply_linux_heuristics(tinfo* ti, unsigned nonewfonts){
|
apply_linux_heuristics(tinfo* ti, unsigned nonewfonts){
|
||||||
const char* tname = NULL;
|
const char* tname = NULL;
|
||||||
@ -958,6 +965,9 @@ apply_term_heuristics(tinfo* ti, const char* tname, queried_terminals_e qterm,
|
|||||||
case TERMINAL_TERMINOLOGY:
|
case TERMINAL_TERMINOLOGY:
|
||||||
newname = apply_terminology_heuristics(ti);
|
newname = apply_terminology_heuristics(ti);
|
||||||
break;
|
break;
|
||||||
|
case TERMINAL_KONSOLE:
|
||||||
|
newname = apply_konsole_heuristics(ti);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
newname = tname;
|
newname = tname;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user