From 59b25d45feb35325aebb35c45046d1c0a9fcd3de Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 2 Apr 2026 23:50:07 +0900 Subject: [PATCH] internal/pkg: pick up $TERM if attaching stdin This improves behaviour of some programs. Signed-off-by: Ophestra --- internal/pkg/exec.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/pkg/exec.go b/internal/pkg/exec.go index a78dab84..6b6964fd 100644 --- a/internal/pkg/exec.go +++ b/internal/pkg/exec.go @@ -579,6 +579,11 @@ func (c *Cache) EnterExec( z.Stdin, z.Stdout, z.Stderr = stdin, stdout, stderr z.Path, z.Args = path, args z.RetainSession = retainSession + if stdin == os.Stdin { + if s, ok := os.LookupEnv("TERM"); ok { + z.Env = append(z.Env, "TERM="+s) + } + } if err = z.Start(); err != nil { return