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:
parent
39f3da3a82
commit
b5e016e6f5
@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user