Skip to content

Commit

Permalink
Remove checking for error from session end in web terminal (#8797) (#…
Browse files Browse the repository at this point in the history
…8816)

Removes the call for wait for ssh.Session end to check for errors
in web terminal which fixes a regression bug where typing "exit" 
in web terminal does not return session end event. 
PR #8081 removed the need to check for errors as it correctly 
returns exit errors whereas before it returned nil.
  • Loading branch information
kimlisa authored Nov 2, 2021
1 parent 0f71ec5 commit 7b3edf9
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/web/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,16 +494,6 @@ func (t *TerminalHandler) streamTerminal(ws *websocket.Conn, tc *client.Teleport
return
}

// Check if remote process exited with error code, eg: RemoteCommandFailure (255).
if t.sshSession != nil {
if err := t.sshSession.Wait(); err != nil {
if exitErr, ok := err.(*ssh.ExitError); ok {
t.log.Warnf("Remote shell exited with error code: %v", exitErr.ExitStatus())
return
}
}
}

// Send close envelope to web terminal upon exit without an error.
envelope := &Envelope{
Version: defaults.WebsocketVersion,
Expand Down

0 comments on commit 7b3edf9

Please # to comment.