add ESCAPE_NOBOLD (sgr22) to avoid sgr0 #1818

pull/1838/head
nick black 3 years ago
parent 8cb70a30bb
commit 63271e5f54
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -464,13 +464,16 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname, unsigned utf8,
unsigned ncvbit; // bit in "ncv" mask for unconditional deny
} styles[] = {
{ NCSTYLE_BOLD, "bold", A_BOLD },
{ NCSTYLE_REVERSE, "rev", A_REVERSE },
{ NCSTYLE_UNDERLINE, "smul", A_UNDERLINE },
{ NCSTYLE_DIM, "dim", A_DIM },
{ NCSTYLE_ITALIC, "sitm", A_ITALIC },
{ NCSTYLE_STRUCK, "smxx", 0 },
{ 0, NULL, 0 }
};
if(get_escape(ti, ESCAPE_BOLD) == NULL){
if(grow_esc_table(ti, "\e[22m", ESCAPE_NOBOLD, &tablelen, &tableused)){
goto err;
}
}
const char* sgr = get_escape(ti, ESCAPE_SGR);
int nocolor_stylemask = tigetnum("ncv");
for(typeof(*styles)* s = styles ; s->s ; ++s){

@ -45,6 +45,7 @@ typedef enum {
ESCAPE_CUB, // "cub" move n cells back (left)
ESCAPE_CUF, // "cuf" move n cells forward (right)
ESCAPE_BOLD, // "bold" enter bold mode
ESCAPE_NOBOLD, // disable bold (ANSI but not terminfo, SGR 22)
ESCAPE_CUD, // "cud" move n cells down
ESCAPE_CUF1, // "cuf1" move 1 cell forward (right)
ESCAPE_SMKX, // "smkx" keypad_xmit (keypad transmit mode)

Loading…
Cancel
Save