capture uname

This commit is contained in:
sawka 2022-08-17 12:54:40 -07:00
parent 249bf88a4d
commit b142e350be

View File

@ -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() {