mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-03 13:21:56 +02:00
fix delta again
This commit is contained in:
parent
8abc953582
commit
02bf6a5c17
@ -12,18 +12,24 @@ import (
|
||||
"github.com/jesseduffield/gocui"
|
||||
)
|
||||
|
||||
func (gui *Gui) desiredPtySize() *pty.Winsize {
|
||||
width, height := gui.Views.Main.Size()
|
||||
|
||||
return &pty.Winsize{Cols: uint16(width), Rows: uint16(height)}
|
||||
}
|
||||
|
||||
func (gui *Gui) onResize() error {
|
||||
if gui.State.Ptmx == nil {
|
||||
return nil
|
||||
}
|
||||
width, height := gui.Views.Main.Size()
|
||||
|
||||
if err := pty.Setsize(gui.State.Ptmx, &pty.Winsize{Cols: uint16(width), Rows: uint16(height)}); err != nil {
|
||||
// TODO: handle resizing properly: we need to actually clear the main view
|
||||
// and re-read the output from our pty. Or we could just re-run the original
|
||||
// command from scratch
|
||||
if err := pty.Setsize(gui.State.Ptmx, gui.desiredPtySize()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO: handle resizing properly
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -52,7 +58,7 @@ func (gui *Gui) newPtyTask(view *gocui.View, cmd *exec.Cmd, prefix string) error
|
||||
manager := gui.getManager(view)
|
||||
|
||||
start := func() (*exec.Cmd, io.Reader) {
|
||||
ptmx, err := pty.Start(cmd)
|
||||
ptmx, err := pty.StartWithSize(cmd, gui.desiredPtySize())
|
||||
if err != nil {
|
||||
gui.Log.Error(err)
|
||||
}
|
||||
@ -67,10 +73,6 @@ func (gui *Gui) newPtyTask(view *gocui.View, cmd *exec.Cmd, prefix string) error
|
||||
gui.State.Ptmx = nil
|
||||
}
|
||||
|
||||
if err := gui.onResize(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := manager.NewTask(manager.NewCmdTask(start, prefix, height+oy+10, onClose), cmdStr); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user