1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-14 18:27:25 +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,11 +48,13 @@ func NewClient(so socketio.Socket, session *Session) *Client {
break
}
}
vp := session.GetSmallestViewPort()
// Resize all terminals in the session
wsServer.BroadcastTo(session.Id, "viewport resize", vp.Cols, vp.Rows)
for _, instance := range session.Instances {
instance.ResizeTerminal(vp.Cols, vp.Rows)
if len(session.Clients) > 0 {
vp := session.GetSmallestViewPort()
// Resize all terminals in the session
wsServer.BroadcastTo(session.Id, "viewport resize", vp.Cols, vp.Rows)
for _, instance := range session.Instances {
instance.ResizeTerminal(vp.Cols, vp.Rows)
}
}
})