slave: set TERMINFO instead of TERMINFO_DIRS

This seems to be slightly better supported than TERMINFO_DIRS. It also
simplifies our code, since it’s no longer an issue of whether to
append or not - we just set TERMINFO, and ignore whatever it was set
to before.

Also closes #687
This commit is contained in:
Daniel Eklöf 2021-08-18 20:18:35 +02:00
parent ee68a3fe95
commit 8a7264e905
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 20 additions and 28 deletions

10
slave.c
View file

@ -290,15 +290,7 @@ slave_spawn(int ptmx, int argc, const char *cwd, char *const *argv,
setenv("COLORTERM", "truecolor", 1);
#if defined(FOOT_TERMINFO_PATH)
const char *terminfo_dirs = getenv("TERMINFO_DIRS");
if (terminfo_dirs != NULL) {
char *updated_terminfo_dirs =
xasprintf("%s:%s", terminfo_dirs, FOOT_TERMINFO_PATH);
setenv("TERMINFO_DIRS", updated_terminfo_dirs, 1);
free(updated_terminfo_dirs);
} else
setenv("TERMINFO_DIRS", FOOT_TERMINFO_PATH, 1);
setenv("TERMINFO", FOOT_TERMINFO_PATH, 1);
#endif
char **_shell_argv = NULL;