From c824ec2ec70bcc1d92927181b5e6d0bb18a9bdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 15 Apr 2018 12:16:55 +0200 Subject: 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 --- ui-terminal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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))) { -- cgit v1.2.3