aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-31 15:09:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-31 15:09:06 +0000
commitd4ee9be4d767ff4927c9e322bdbf958841dc091d (patch)
treeab8adafe11e3bae878f38e9559b1abbf937f48a1 /config.c
parentconfig: configuration errors are no longer fatal (diff)
config: add 'hide-when-typing'
When enabled, the mouse cursor is hidden when the user types in the terminal. It is un-hidden when the user moves the mouse, or when the window loses keyboard focus.
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/config.c b/config.c
index a069877a..fb939f50 100644
--- a/config.c
+++ b/config.c
@@ -517,6 +517,9 @@ parse_section_cursor(const char *key, const char *value, struct config *conf,
else if (strcmp(key, "blink") == 0)
conf->cursor.blink = str_to_bool(value);
+ else if (strcmp(key, "hide-when-typing") == 0)
+ conf->cursor.hide_when_typing = str_to_bool(value);
+
else if (strcmp(key, "color") == 0) {
char *value_copy = strdup(value);
const char *text = strtok(value_copy, " ");
@@ -1251,6 +1254,7 @@ config_load(struct config *conf, const char *conf_path, bool errors_are_fatal)
.cursor = {
.style = CURSOR_BLOCK,
.blink = false,
+ .hide_when_typing = false,
.color = {
.text = 0,
.cursor = 0,