From b142e350be28ba3ecf77e26d573c11b2a6f73e52 Mon Sep 17 00:00:00 2001 From: sawka Date: Wed, 17 Aug 2022 12:54:40 -0700 Subject: [PATCH] capture uname --- pkg/remote/remote.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/remote/remote.go b/pkg/remote/remote.go index c90ebd87..e993fedc 100644 --- a/pkg/remote/remote.go +++ b/pkg/remote/remote.go @@ -64,6 +64,7 @@ type MShellProc struct { // runtime Status string ServerProc *shexec.ClientProc + UName string Err error RunningCmds []base.CommandKey @@ -183,12 +184,15 @@ func (msh *MShellProc) Launch() { defer msh.Lock.Unlock() ecmd := convertSSHOpts(msh.Remote.SSHOpts).MakeSSHExecCmd(MShellServerCommand) - cproc, err := shexec.MakeClientProc(ecmd) + cproc, uname, err := shexec.MakeClientProc(ecmd) + msh.UName = uname if err != nil { msh.Status = StatusError msh.Err = err + fmt.Printf("[error] connecting remote %s (%s): %w\n", msh.Remote.GetName(), msh.UName, err) return } + fmt.Printf("connected remote %s\n", msh.Remote.GetName()) msh.ServerProc = cproc msh.Status = StatusConnected go func() {