func (s *Server) handleTerminalResize(sconn *ssh.ServerConn, ch ssh.Channel) {
	// the party may not be immediately available for this connection,
	// keep asking for a full second:
	for i := 0; i < 10; i++ {
		party := s.reg.PartyForConnection(sconn)
		if party == nil {
			time.Sleep(time.Millisecond * 100)
			continue
		}
		// this starts a loop which will keep updating the terminal
		// size for every SSH write back to this connection
		party.termSizePusher(ch)
		return
	}
}
// handleTerminalResize is called by the web proxy via its SSH connection.
// when a web browser connects to the web API, the web proxy asks us,
// by creating this new SSH channel, to start injecting the terminal size
// into every SSH write back to it.
//
// this is the only way to make web-based terminal UI not break apart
// when window changes its size
handleTerminalResize is called by the web proxy via its SSH connection.
when a web browser connects to the web API, the web proxy asks us,
by creating this new SSH channel, to start injecting the terminal size
into every SSH write back to it.

this is the only way to make web-based terminal UI not break apart
when window changes its size
// handleTerminalResize is called by the web proxy via its SSH connection . // when a web browser connects to the web API the web proxy asks us // by creating this new SSH channel to start injecting the terminal size // into every SSH write back to it . // // this is the only way to make web - based terminal UI not break apart // when window changes its size
func (s *Server) handleTerminalResize(sconn *ssh.ServerConn, ch ssh.Channel) {
	for i := 0; i < 10; i++ {
		party := s.reg.PartyForConnection(sconn)
		if party == nil {
			time.Sleep(time.Millisecond * 100)
			continue
		}
		party.termSizePusher(ch)
		return
	}
}
func ( s * Server ) handleTerminalResize ( sconn * ssh . ServerConn , ch ssh . Channel ) { for i := 0 ; i < 10 ; i ++ { party := s . reg . PartyForConnection ( sconn ) if party == nil { time . Sleep ( time . Millisecond * 100 ) continue } party . termSizePusher ( ch ) return } }
handleTerminalResize is called by the web proxy via its SSH connection.
handleTerminalResize is called by the web proxy via its SSH connection .
// the party may not be immediately available for this connection, // keep asking for a full second: // this starts a loop which will keep updating the terminal // size for every SSH write back to this connection