diff --git a/config.c b/config.c index c433ad02..6d234264 100644 --- a/config.c +++ b/config.c @@ -85,9 +85,9 @@ static bool parse_section_main(const char *key, const char *value, struct config *conf, const char *path, unsigned lineno) { - if (strcmp(key, "font") == 0) { - free(conf->font); - conf->font = strdup(value); + if (strcmp(key, "term") == 0) { + free(conf->term); + conf->term = strdup(value); } else if (strcmp(key, "shell") == 0) { @@ -95,6 +95,11 @@ parse_section_main(const char *key, const char *value, struct config *conf, conf->shell = strdup(value); } + else if (strcmp(key, "font") == 0) { + free(conf->font); + conf->font = strdup(value); + } + else { LOG_WARN("%s:%u: invalid key: %s", path, lineno, key); return false; @@ -211,6 +216,7 @@ config_load(struct config *conf) bool ret = false; *conf = (struct config) { + .term = strdup("foot"), .shell = get_shell(), .font = strdup("monospace"), }; diff --git a/config.h b/config.h index aa96a49b..fdca3c34 100644 --- a/config.h +++ b/config.h @@ -3,6 +3,7 @@ #include struct config { + char *term; char *shell; char *font; }; diff --git a/main.c b/main.c index 2c8f0451..70ca3d48 100644 --- a/main.c +++ b/main.c @@ -312,7 +312,7 @@ main(int argc, char *const *argv) argv += optind; setlocale(LC_ALL, ""); - setenv("TERM", "foot", 1); /* TODO: configurable */ + setenv("TERM", conf.term, 1); int repeat_pipe_fds[2] = {-1, -1}; if (pipe2(repeat_pipe_fds, O_CLOEXEC) == -1) {