1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-15 18:57:28 +08:00

When there are no more clients, don't try to measure best viewport size

This commit is contained in:
Jonathan Leibiusky (@xetorthio) 2016-11-10 16:23:54 -03:00
parent 39f3da3a82
commit b5e016e6f5

View File

@ -48,12 +48,14 @@ func NewClient(so socketio.Socket, session *Session) *Client {
break break
} }
} }
if len(session.Clients) > 0 {
vp := session.GetSmallestViewPort() vp := session.GetSmallestViewPort()
// Resize all terminals in the session // Resize all terminals in the session
wsServer.BroadcastTo(session.Id, "viewport resize", vp.Cols, vp.Rows) wsServer.BroadcastTo(session.Id, "viewport resize", vp.Cols, vp.Rows)
for _, instance := range session.Instances { for _, instance := range session.Instances {
instance.ResizeTerminal(vp.Cols, vp.Rows) instance.ResizeTerminal(vp.Cols, vp.Rows)
} }
}
}) })
return c return c