internal/pkg: pick up $TERM if attaching stdin

This improves behaviour of some programs.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-04-02 23:50:07 +09:00
parent 9b99650eb1
commit 59b25d45fe

View File

@@ -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