diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-04-02 23:50:07 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-04-02 23:50:07 +0900 |
| commit | 59b25d45feb35325aebb35c45046d1c0a9fcd3de (patch) | |
| tree | 8ad59382751a994545f62357e92f7cb95bc0872e /internal/pkg/exec.go | |
| parent | 9b99650eb16c88a33eecd660100fbd296e2e0bba (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.go | 5 |
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 |
