handleResize handles terminal resize events.
()
| 683 | |
| 684 | // handleResize handles terminal resize events. |
| 685 | func (p *Program) handleResize() chan struct{} { |
| 686 | ch := make(chan struct{}) |
| 687 | |
| 688 | if p.ttyOutput != nil { |
| 689 | // Listen for window resizes. |
| 690 | go p.listenForResize(ch) |
| 691 | } else { |
| 692 | close(ch) |
| 693 | } |
| 694 | |
| 695 | return ch |
| 696 | } |
| 697 | |
| 698 | // handleCommands runs commands in a goroutine and sends the result to the |
| 699 | // program's message channel. |