From f42963de8b198e319872a828258c30a6f38f23d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20M=C3=B6rbitz?= Date: Sat, 21 Oct 2017 00:16:25 +0200 Subject: [PATCH] term: make TERM environment variable configurable The TERM environment variable can be set in the config now (default remains `linux`). Thus, it is no longer necessary to add export statements to your shell rc files. --- conf.h | 3 +++ term.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conf.h b/conf.h index 0d096d1..f70d25e 100644 --- a/conf.h +++ b/conf.h @@ -10,6 +10,9 @@ #define EDITOR {"vi"} #define MAIL {"mailx", "-f", "+inbox"} +/* TERM variable for launched programs */ +#define TERM "linux" + /* fbval_t should match framebuffer depth */ typedef unsigned int fbval_t; diff --git a/term.c b/term.c index 0055e83..40fb8f0 100644 --- a/term.c +++ b/term.c @@ -341,7 +341,7 @@ void term_exec(char **args) if ((term->pid = fork()) == -1) return; if (!term->pid) { - char *envp[MAXENV] = {"TERM=linux"}; + char *envp[MAXENV] = {"TERM=" TERM}; envcpy(envp + 1, environ); _login(slave); close(master);