set HOME=/perm/home for persistent configs in interactive usage
As a welcome side effect, this enables persistent shell history by default!
This commit is contained in:
parent
0ee50d0171
commit
0a14bc7f0c
4
ssh.go
4
ssh.go
@ -314,7 +314,9 @@ func (s *session) request(ctx context.Context, req *ssh.Request) error {
|
|||||||
cmd = exec.CommandContext(ctx, cmdline[0], cmdline[1:]...)
|
cmd = exec.CommandContext(ctx, cmdline[0], cmdline[1:]...)
|
||||||
}
|
}
|
||||||
log.Printf("Starting cmd %q", cmd.Args)
|
log.Printf("Starting cmd %q", cmd.Args)
|
||||||
cmd.Env = expandPath(s.env)
|
env := expandPath(s.env)
|
||||||
|
env = append(env, "HOME=/perm/home")
|
||||||
|
cmd.Env = env
|
||||||
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
||||||
|
|
||||||
if s.ttyf == nil {
|
if s.ttyf == nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user