[lxc-devel] [lxd/master] propagate the host's TERM to shell sessions

tych0 on Github lxc-bot at linuxcontainers.org
Wed Aug 17 14:30:30 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 377 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160817/5d0fddd9/attachment.bin>
-------------- next part --------------
From 0472ec00ec37cdc8ef4ebf9ea4ecc756624d4222 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.andersen at canonical.com>
Date: Wed, 17 Aug 2016 08:27:26 -0600
Subject: [PATCH] propagate the host's TERM to shell sessions

Closes #2288

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 lxc/exec.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxc/exec.go b/lxc/exec.go
index 87427ed..e603ea3 100644
--- a/lxc/exec.go
+++ b/lxc/exec.go
@@ -95,7 +95,7 @@ func (c *execCmd) run(config *lxd.Config, args []string) error {
 		return err
 	}
 
-	env := map[string]string{"HOME": "/root", "USER": "root"}
+	env := map[string]string{"HOME": "/root", "USER": "root", "TERM": os.Getenv("TERM")}
 	myEnv := os.Environ()
 	for _, ent := range myEnv {
 		if strings.HasPrefix(ent, "TERM=") {


More information about the lxc-devel mailing list