Skip to content

Commit

Permalink
Rename Mode to TermEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
matttpt committed Apr 3, 2023
1 parent dcaa03e commit ba10645
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions internal/command/ssh/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ func runConsole(ctx context.Context) error {
}

sessIO := &ssh.SessionIO{
Stdin: params.Stdin,
Stdout: params.Stdout,
Stderr: params.Stderr,
Mode: "xterm",
Stdin: params.Stdin,
Stdout: params.Stdout,
Stderr: params.Stderr,
TermEnv: "xterm",
}

currentStdin, currentStdout, currentStderr, err := setupConsole()
Expand Down
8 changes: 4 additions & 4 deletions internal/command/ssh/ssh_terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ func SSHConnect(p *SSHParams, addr string) error {
}

sessIO := &ssh.SessionIO{
Stdin: p.Stdin,
Stdout: p.Stdout,
Stderr: p.Stderr,
Mode: "xterm",
Stdin: p.Stdin,
Stdout: p.Stdout,
Stderr: p.Stderr,
TermEnv: "xterm",
}

if err := sshClient.Shell(context.Background(), sessIO, p.Cmd); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions ssh/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type SessionIO struct {
Stdout io.WriteCloser
Stderr io.WriteCloser

Mode string
TermEnv string
}

func getFd(reader io.Reader) (fd int, ok bool) {
Expand Down Expand Up @@ -67,7 +67,7 @@ func (s *SessionIO) attach(ctx context.Context, sess *ssh.Session, cmd string) e
}
}

if err := sess.RequestPty(s.Mode, height, width, modes); err != nil {
if err := sess.RequestPty(s.TermEnv, height, width, modes); err != nil {
return err
}

Expand Down

0 comments on commit ba10645

Please sign in to comment.