mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-15 10:47:26 +08:00
When there are no more clients, don't try to measure best viewport size
This commit is contained in:
parent
39f3da3a82
commit
b5e016e6f5
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user