summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2015-08-26 11:55:48 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2015-08-26 11:55:48 +0200
commit86d17e1d734020cf8d6d2517c8575afeebd74b48 (patch)
tree075f502aea62dd3fb89e9beb39b48fd94780d9be /src
parentbe5afe9f5fdf0b2295cf728a9623b0b5347fe8f4 (diff)
parent89fec31893bd71292de5ab88cd73816148165b2f (diff)
Merge pull request #1047 from poettering/machinectl-TERM
machinectl: pass $TERM into "machinectl shell" sessions
Diffstat (limited to 'src')
-rw-r--r--src/machine/machinectl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index f9f49ee892..926035d185 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);