From f4e8f055fbd0c0237847935ae87dd0a582133203 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 27 Feb 2021 16:28:21 -0500 Subject: Add workaround for lack of A_ITALIC in old ncurses A_BLINK has probably always existed, but there's no good reason to ever use it, so make it do italics instead. Normally all attributes are set by a single set_attributes string if it's set, so clear it to force ncurses to use the reassigned enter_blink_mode string. If the terminal has no enter_italics_mode string, then nothing will happen. This makes setting multiple attributes a bit less efficient, but I don't think it's likely to make much of a difference since using multiple attributes at once is so uncommon. --- ui.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ui.c') diff --git a/ui.c b/ui.c index 3c6c4ed..d18ea74 100644 --- a/ui.c +++ b/ui.c @@ -53,10 +53,6 @@ #undef lines #undef tab -#ifndef A_ITALIC -#define A_ITALIC A_NORMAL -#endif - enum { StatusLines = 1, MarkerLines = 1, @@ -241,6 +237,13 @@ void uiInitEarly(void) { colorInit(); atexit(errExit); +#ifndef A_ITALIC +#define A_ITALIC A_BLINK + // Force ncurses to use individual enter_attr_mode strings: + set_attributes = NULL; + enter_blink_mode = enter_italics_mode; +#endif + if (!to_status_line && !strncmp(termname(), "xterm", 5)) { to_status_line = "\33]2;"; from_status_line = "\7"; -- cgit 1.4.1