Skip to content

Commit 43811cd

Browse files
stkstefanhaller
authored andcommitted
Export a LAZYGIT_COLUMNS variable to "pty" tasks on Windows
This makes it possible to pass it to an external diff command that is used like a pager. An example for this can be seen in the added documentation in the next commit.
1 parent 4b59f98 commit 43811cd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/gui/pty_windows.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package gui
22

33
import (
4+
"fmt"
45
"os/exec"
56

67
"github.com/jesseduffield/gocui"
@@ -11,5 +12,6 @@ func (gui *Gui) onResize() error {
1112
}
1213

1314
func (gui *Gui) newPtyTask(view *gocui.View, cmd *exec.Cmd, prefix string) error {
15+
cmd.Env = append(cmd.Env, fmt.Sprintf("LAZYGIT_COLUMNS=%d", view.InnerWidth()))
1416
return gui.newCmdTask(view, cmd, prefix)
1517
}

0 commit comments

Comments
 (0)