aboutsummaryrefslogtreecommitdiff
path: root/session.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-04 23:20:29 +0700
committerShulhan <ms@kilabit.info>2023-09-04 23:20:29 +0700
commit83d746e4f95d661fc0ab21238b34eeecd2288412 (patch)
treef3a8671fcc715803109e120a6380579ec48722f7 /session.go
parente7dc577ba54ec9b9f29c1b6845765f637e1b6408 (diff)
downloadawwan-83d746e4f95d661fc0ab21238b34eeecd2288412.tar.xz
go.mod: update share module
The latest update on share module contains refactoring on lib/ssh.
Diffstat (limited to 'session.go')
-rw-r--r--session.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/session.go b/session.go
index 6d5cd02..19a6a1d 100644
--- a/session.go
+++ b/session.go
@@ -397,7 +397,7 @@ func (ses *Session) executeScriptOnLocal(req *Request, pos linePosition) {
continue
}
- fmt.Fprintf(req.stdout, "\n>>> local: %3d: %s %s\n", x, stmt.cmd, stmt.args)
+ fmt.Fprintf(req.stdout, "\n>>> local: %3d: %s\n", x, stmt.raw)
var err error
switch stmt.kind {
@@ -507,11 +507,10 @@ func (ses *Session) initSSHClient(req *Request, sshSection *config.Section) (err
lastIdentFile = sshSection.IdentityFile[len(sshSection.IdentityFile)-1]
}
- fmt.Fprintf(req.stdout, "--- SSH connection: %s@%s:%s\n",
- sshSection.User, sshSection.Hostname, sshSection.Port)
- fmt.Fprintf(req.stdout, "--- SSH identity file: %s\n", lastIdentFile)
+ fmt.Fprintf(req.stdout, "--- SSH connection: %s@%s:%s\n", sshSection.User(), sshSection.Hostname(), sshSection.Port())
+ fmt.Fprintf(req.stdout, "--- SSH identity file: %v\n", sshSection.IdentityFile)
- ses.sshClient, err = ssh.NewClientFromConfig(sshSection)
+ ses.sshClient, err = ssh.NewClientInteractive(sshSection)
if err != nil {
return fmt.Errorf("%s: %w", logp, err)
}
@@ -525,9 +524,9 @@ func (ses *Session) initSSHClient(req *Request, sshSection *config.Section) (err
ses.sshClient.SetSessionOutputError(req.stdout, req.stderr)
ses.SSHKey = lastIdentFile
- ses.SSHUser = sshSection.User
- ses.SSHHost = sshSection.Hostname
- ses.SSHPort = sshSection.Port
+ ses.SSHUser = sshSection.User()
+ ses.SSHHost = sshSection.Hostname()
+ ses.SSHPort = sshSection.Port()
return nil
}