From 50928fc1ef26b946ae278ca6d15209a93594f169 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Sat, 26 Mar 2016 11:44:37 +0800 Subject: [PATCH] set/unset TERM environment based on tty config Signed-off-by: Lai Jiangshan --- src/container.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/container.c b/src/container.c index 06a9097..71bd9e4 100644 --- a/src/container.c +++ b/src/container.c @@ -350,6 +350,10 @@ static int hyper_container_init(void *data) // set additinal env before config so that the config can overwrite it setenv("HOME", "/root", 1); + if (container->exec.tty) + setenv("TERM", "xterm", 1); + else + unsetenv("TERM"); if (hyper_setup_env(container->envs, container->envs_num) < 0) { fprintf(stdout, "setup env failed\n");