italic attribute on tty

If switching to italic isn't supported for tty, switch to underline
instead.  Comparable to the curses interface.
This commit is contained in:
PatR
2022-09-23 23:37:02 -07:00
parent f9e5e4966a
commit c3b007186c
+10 -8
View File
@@ -1299,6 +1299,11 @@ static char *
s_atr2str(int n) s_atr2str(int n)
{ {
switch (n) { switch (n) {
case ATR_ITALIC:
/* if italic isn't available, fall through to underline */
if (ZH && *ZH)
return ZH;
/*FALLTHRU*/
case ATR_BLINK: case ATR_BLINK:
case ATR_ULINE: case ATR_ULINE:
if (n == ATR_BLINK) { if (n == ATR_BLINK) {
@@ -1323,10 +1328,6 @@ s_atr2str(int n)
if (MH && *MH) if (MH && *MH)
return MH; return MH;
break; break;
case ATR_ITALIC:
if (ZH && *ZH)
return ZH;
break;
} }
return nulstr; return nulstr;
} }
@@ -1335,6 +1336,11 @@ static char *
e_atr2str(int n) e_atr2str(int n)
{ {
switch (n) { switch (n) {
case ATR_ITALIC:
/* send ZR unless we didn't have ZH and substituted US */
if (ZR && *ZR && ZH && *ZH)
return ZR;
/*FALLTHRU*/
case ATR_ULINE: case ATR_ULINE:
if (nh_UE && *nh_UE) if (nh_UE && *nh_UE)
return nh_UE; return nh_UE;
@@ -1349,10 +1355,6 @@ e_atr2str(int n)
if (ME && *ME) if (ME && *ME)
return ME; return ME;
break; break;
case ATR_ITALIC:
if (ZR && *ZR)
return ZR;
break;
} }
return nulstr; return nulstr;
} }