about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-27 16:28:21 -0500
committerJune McEnroe <june@causal.agency>2021-02-27 16:28:21 -0500
commitf4e8f055fbd0c0237847935ae87dd0a582133203 (patch)
treeca6ff52b9351e743585a6c78727272e1349a189c
parentError if hash bound is less than 2 (diff)
downloadcatgirl-f4e8f055fbd0c0237847935ae87dd0a582133203.tar.gz
catgirl-f4e8f055fbd0c0237847935ae87dd0a582133203.zip
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.
Diffstat (limited to '')
-rw-r--r--ui.c11
1 files changed, 7 insertions, 4 deletions
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";
c403d&follow=1'>Use class names for Foreground, Background, BorderColorJune McEnroe 2021-02-07Add simple battery status and clock to xsessionJune McEnroe 2021-02-07Set cursor theme and sizeJune McEnroe 2021-02-07Use scrot for up -s if no screencaptureJune McEnroe 2021-02-07Enable mouse acceleration in XJune McEnroe 2021-02-07Set colours for Xt and cwmJune McEnroe 2021-02-07Set urgency on bell in xtermJune McEnroe 2021-02-07Add bindings for brightness controlJune McEnroe 2021-02-07Set X key repeat rateJune McEnroe 2021-02-07Bump font size to 12June McEnroe 2021-02-07Fully configure and rebind cwmJune McEnroe 2021-02-07Add BintiJune McEnroe 2021-02-07Finish configuring xtermJune McEnroe 2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe 2021-02-06Set root window to black on purple snowJune McEnroe 2021-02-06Add xmodmap configurationJune McEnroe 2021-02-06Add initial OpenBSD X configurationJune McEnroe 2021-02-06Add xterm output to schemeJune McEnroe