From: Lennart Poettering Date: Wed, 26 Aug 2015 08:07:21 +0000 (+0200) Subject: machinectl: pass $TERM into "machinectl shell" sessions X-Git-Tag: v225~13^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1047%2Fhead;p=thirdparty%2Fsystemd.git machinectl: pass $TERM into "machinectl shell" sessions --- diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index f9f49ee8922..926035d1853 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -1309,6 +1309,17 @@ static int shell_machine(int argc, char *argv[], void *userdata) { return -EOPNOTSUPP; } + /* Pass $TERM to shell session, if not explicitly specified. */ + if (!strv_find_prefix(arg_setenv, "TERM=")) { + const char *t; + + t = strv_find_prefix(environ, "TERM="); + if (t) { + if (strv_extend(&arg_setenv, t) < 0) + return log_oom(); + } + } + polkit_agent_open_if_enabled(); r = sd_event_default(&event);