Remove checking for error from session end in web terminal (#8797)

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.
This commit is contained in:
Lisa Kim 2021-11-01 17:55:59 -07:00 committed by GitHub
parent 878539bf49
commit 092e3ab72e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,