diff options
Diffstat (limited to 'src/machine/machinectl.c')
-rw-r--r-- | src/machine/machinectl.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 6b29e61642..926035d185 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -1225,7 +1225,7 @@ static int process_forward(sd_event *event, PTYForward **forward, int master, bo } static int login_machine(int argc, char *argv[], void *userdata) { - _cleanup_bus_message_unref_ sd_bus_message *reply = NULL, *m = NULL; + _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_(pty_forward_freep) PTYForward *forward = NULL; _cleanup_bus_slot_unref_ sd_bus_slot *slot = NULL; @@ -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); |