code: func (s *sizeQueue) monitorSize(outFd uintptr, initialSizes ...*remotecommand.TerminalSize) {
  	// send the initial sizes
  	for i := range initialSizes {
  		if initialSizes[i] != nil {
  			s.resizeChan <- *initialSizes[i]
  		}
  	}
  
  	resizeEvents := make(chan remotecommand.TerminalSize, 1)
  
  	monitorResizeEvents(outFd, resizeEvents, s.stopResizing)
  
  	// listen for resize events in the background
  	go func() {
  		defer runtime.HandleCrash()
  
  		for {
  			select {
  			case size, ok := <-resizeEvents:
  				if !ok {
  					return
  				}
  
  				select {
  				// try to send the size to resizeChan, but don't block
  				case s.resizeChan <- size:
  					// send successful
  				default:
  					// unable to send / no-op
  				}
  			case <-s.stopResizing:
  				return
  			}
  		}
  	}()
  }
docs: // monitorSize primes resizeChan with initialSizes and then monitors for resize events. With each
  // new event, it sends the current terminal size to resizeChan.