aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/exec.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-04-02 23:50:07 +0900
committerOphestra <cat@gensokyo.uk>2026-04-02 23:50:07 +0900
commit59b25d45feb35325aebb35c45046d1c0a9fcd3de (patch)
tree8ad59382751a994545f62357e92f7cb95bc0872e /internal/pkg/exec.go
parent9b99650eb16c88a33eecd660100fbd296e2e0bba (diff)
internal/pkg: pick up $TERM if attaching stdin
This improves behaviour of some programs. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/exec.go')
-rw-r--r--internal/pkg/exec.go5
1 files changed, 5 insertions, 0 deletions
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