(resized <-chan os.Signal, session SecureSession, terminalFd uintptr)
| 390 | } |
| 391 | |
| 392 | func (c *secureShell) resize(resized <-chan os.Signal, session SecureSession, terminalFd uintptr) { |
| 393 | type resizeMessage struct { |
| 394 | Width uint32 |
| 395 | Height uint32 |
| 396 | PixelWidth uint32 |
| 397 | PixelHeight uint32 |
| 398 | } |
| 399 | |
| 400 | var previousWidth, previousHeight int |
| 401 | |
| 402 | for range resized { |
| 403 | width, height := c.getWindowDimensions(terminalFd) |
| 404 | |
| 405 | if width == previousWidth && height == previousHeight { |
| 406 | continue |
| 407 | } |
| 408 | |
| 409 | message := resizeMessage{ |
| 410 | Width: uint32(width), |
| 411 | Height: uint32(height), |
| 412 | } |
| 413 | |
| 414 | _, _ = session.SendRequest("window-change", false, ssh.Marshal(message)) |
| 415 | |
| 416 | previousWidth = width |
| 417 | previousHeight = height |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | func keepalive(conn ssh.Conn, ticker *time.Ticker, stopCh chan struct{}) { |
| 422 | for { |
no test coverage detected