aboutsummaryrefslogtreecommitdiff
path: root/ui-terminal.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2018-04-15 12:16:55 +0200
committerMarc André Tanner <mat@brain-dump.org>2018-04-15 12:16:55 +0200
commitc824ec2ec70bcc1d92927181b5e6d0bb18a9bdd1 (patch)
tree480b3254c13e47faa4e2b1b7ef834452ae6b1dd5 /ui-terminal.c
parent7d1f70e18cce00ca3fea43f392a3ea3a367f18b9 (diff)
downloadvis-c824ec2ec70bcc1d92927181b5e6d0bb18a9bdd1.tar.gz
vis-c824ec2ec70bcc1d92927181b5e6d0bb18a9bdd1.tar.xz
ui: make sure $TERM is set
libtermkey passes the $TERM value unchecked to libunibilium which just aborts (in debug builds) or crashes (in release builds). Workaround that by defaulting to `xterm`, if $TERM is unset. It should eventually be fixed in libtermkey/unibilium too. This fixes test suite failures on the Debian package build environment. It might also be the reason for failures in other CI environments e.g.: https://github.com/alpinelinux/aports/pull/3768
Diffstat (limited to 'ui-terminal.c')
-rw-r--r--ui-terminal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui-terminal.c b/ui-terminal.c
index d42ee9b..bcf4f48 100644
--- a/ui-terminal.c
+++ b/ui-terminal.c
@@ -644,8 +644,10 @@ static bool ui_init(Ui *ui, Vis *vis) {
setlocale(LC_CTYPE, "");
char *term = getenv("TERM");
- if (!term)
+ if (!term) {
term = "xterm";
+ setenv("TERM", term, 1);
+ }
errno = 0;
if (!(tui->termkey = ui_termkey_new(STDIN_FILENO))) {