forked from rosa/hakurei
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:
@@ -579,6 +579,11 @@ func (c *Cache) EnterExec(
|
|||||||
z.Stdin, z.Stdout, z.Stderr = stdin, stdout, stderr
|
z.Stdin, z.Stdout, z.Stderr = stdin, stdout, stderr
|
||||||
z.Path, z.Args = path, args
|
z.Path, z.Args = path, args
|
||||||
z.RetainSession = retainSession
|
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 {
|
if err = z.Start(); err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user