commit 35e788c8bb9f8b2a780084dd83ce3e5560fdfa4a
parent b6746dbaaca9d8036f4749457475480db2a4478d
Author: Rob King <rob@frigidriver.com>
Date: Fri, 5 Aug 2022 23:35:23 -0500
Add REVERSE_ITALICS
Diffstat:
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
@@ -3,6 +3,12 @@
#define NO_ITALICS
*/
+/* mtm advertises support for italic text by default. If the host
+ * terminal does not support italics, this will fail. Define this
+ * to map italic text to reverse text.
+#define REVERSE_ITALICS
+ */
+
/* mtm by default will advertise itself as a "screen-bce" terminal.
* This is the terminal type advertised by such programs as
* screen(1) and tmux(1) and is a widely-supported terminal type.
diff --git a/mtm.c b/mtm.c
@@ -503,10 +503,14 @@ HANDLER(sgr) /* SGR - Select Graphic Rendition */
case 105: bg = COLOR_MAGENTA; doc = do16; break;
case 106: bg = COLOR_CYAN; doc = do16; break;
case 107: bg = COLOR_WHITE; doc = do16; break;
- #if defined(A_ITALIC) && !defined(NO_ITALICS )
+ #if defined(A_ITALIC) && !defined(NO_ITALICS) && !defined(REVERSE_ITALICS)
case 3: wattron(win, A_ITALIC); break;
case 23: wattroff(win, A_ITALIC); break;
#endif
+ #if defined(REVERSE_ITALICS)
+ case 3: wattron(win, A_REVERSE); break;
+ case 23: wattroff(win, A_REVERSE); break;
+ #endif
}
if (doc){
int p = mtm_alloc_pair(s->fg = fg, s->bg = bg);