Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

fleetctl: fixed broken ssh terminal #1499 #1502

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ func makeSession(client *SSHForwardingClient) (session *gossh.Session, finalize
return
}

session.Stdout = os.Stdout
session.Stderr = os.Stderr
session.Stdin = os.Stdin

modes := gossh.TerminalModes{
gossh.ECHO: 1, // enable echoing
gossh.TTY_OP_ISPEED: 14400, // input speed = 14.4kbaud
Expand Down Expand Up @@ -116,6 +112,9 @@ func Execute(client *SSHForwardingClient, cmd string) (error, int) {
return err, -1
}

session.Stdout = os.Stdout
session.Stderr = os.Stderr

defer finalize()

session.Start(cmd)
Expand All @@ -142,6 +141,10 @@ func Shell(client *SSHForwardingClient) error {
return err
}

session.Stdout = os.Stdout
session.Stderr = os.Stderr
session.Stdin = os.Stdin

defer finalize()

if err = session.Shell(); err != nil {
Expand Down