Running over terminals that lack the sitm/ZH (italics mode) capability
is causing the related attr table entry to be initialized with the last
valid capability as a fallback, which happens to be the blinking mode.
Fix this by explicitly falling back to standout mode (reverse video)
when the italics mode capability is missing, which restores the pre
v5.0.0 behavior of screen.
Fixes: d50e9516e99d ("add italics support")
Signed-off-by: Anthony Iliopoulos <[email protected]>
---
src/termcap.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/termcap.c b/src/termcap.c
index b49818b1a7ba..6408793897bd 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -254,6 +254,13 @@ int InitTermcap(int width, int height)
D_attrtyp[i] = i == ATTR_SO ? xse : (i == ATTR_US ? xue : xme);
}
+ /* if $TERM lacks the 'sitm' capability for italics, ensure that we
+ * fall back to standout mode (smso) rather than to blinking mode. */
+ if (D_attrtab[ATTR_IT] == NULL) {
+ D_attrtab[ATTR_IT] = D_attrtab[ATTR_SO];
+ D_attrtyp[ATTR_IT] = D_attrtyp[ATTR_SO];
+ }
+
/* Set up missing entries (attributes are priority ordered) */
s = NULL;
t = 0;
--
2.56.0