aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-04-09 14:28:54 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-04-10 14:24:10 +0000
commite5a2ac4b57c18556e2245ecbf2e4faeef46e2b9d (patch)
treed64f53497988042a566985e486d1d8dd2070f186 /config.c
parentdcs: DECRQSS: fix off-by-one when checking for space in the DCS buffer (diff)
config: add cursor.unfocused-style
This option controls how we render the cursor when the terminal window is unfocused. Possible values are: * hollow: the default, and how we rendered the cursor before this patch. * unchanged: render the cursor exactly the same way as when the window is focused. * none: do not render any cursor at all Closes #1582
Diffstat (limited to 'config.c')
-rw-r--r--config.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/config.c b/config.c
index d2b75180..6a8bb0a8 100644
--- a/config.c
+++ b/config.c
@@ -1383,6 +1383,16 @@ parse_section_cursor(struct context *ctx)
(int *)&conf->cursor.style);
}
+ else if (streq(key, "unfocused-style")) {
+ _Static_assert(sizeof(conf->cursor.unfocused_style) == sizeof(int),
+ "enum is not 32-bit");
+
+ return value_to_enum(
+ ctx,
+ (const char *[]){"unchanged", "hollow", "none", NULL},
+ (int *)&conf->cursor.unfocused_style);
+ }
+
else if (streq(key, "blink"))
return value_to_bool(ctx, &conf->cursor.blink);
@@ -3090,6 +3100,7 @@ config_load(struct config *conf, const char *conf_path,
.cursor = {
.style = CURSOR_BLOCK,
+ .unfocused_style = CURSOR_UNFOCUSED_HOLLOW,
.blink = false,
.color = {
.text = 0,