mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-12 11:15:00 +02:00
22 lines
379 B
Go
22 lines
379 B
Go
package gui
|
|
|
|
import (
|
|
"github.com/jesseduffield/pty"
|
|
)
|
|
|
|
func (gui *Gui) onResize() error {
|
|
if gui.State.Ptmx == nil {
|
|
return nil
|
|
}
|
|
mainView := gui.getMainView()
|
|
width, height := mainView.Size()
|
|
|
|
if err := pty.Setsize(gui.State.Ptmx, &pty.Winsize{Cols: uint16(width), Rows: uint16(height)}); err != nil {
|
|
return err
|
|
}
|
|
|
|
// TODO: handle resizing properly
|
|
|
|
return nil
|
|
}
|