aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/terminal-ssh.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xdsserver/terminal-ssh.go')
-rw-r--r--lib/xdsserver/terminal-ssh.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/xdsserver/terminal-ssh.go b/lib/xdsserver/terminal-ssh.go
index c275173..fcef4f9 100644
--- a/lib/xdsserver/terminal-ssh.go
+++ b/lib/xdsserver/terminal-ssh.go
@@ -223,13 +223,15 @@ func (t *TermSSH) Open(sock *socketio.Socket, sessID string) (*xsapiv1.TerminalC
// Close a terminal
func (t *TermSSH) Close() (*xsapiv1.TerminalConfig, error) {
- // nothing to do when not open
- if t.termCfg.Status != xsapiv1.StatusTermOpen {
+ // nothing to do when not open or closing
+ if ! (t.termCfg.Status == xsapiv1.StatusTermOpen || t.termCfg.Status == xsapiv1.StatusTermClosing) {
return &t.termCfg, nil
}
err := t.sshWS.Signal("SIGTERM")
+ t.termCfg.Status = xsapiv1.StatusTermClosing
+
return &t.termCfg, err
}