From 3372e2bdb612e22e51e6c2d4fd3a07641573b253 Mon Sep 17 00:00:00 2001 From: stk Date: Mon, 6 Oct 2025 16:07:55 +0200 Subject: [PATCH] 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. --- pkg/gui/pty_windows.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/gui/pty_windows.go b/pkg/gui/pty_windows.go index 3324fa87d..39577a199 100644 --- a/pkg/gui/pty_windows.go +++ b/pkg/gui/pty_windows.go @@ -1,6 +1,7 @@ package gui import ( + "fmt" "os/exec" "github.com/jesseduffield/gocui" @@ -11,5 +12,6 @@ func (gui *Gui) onResize() error { } func (gui *Gui) newPtyTask(view *gocui.View, cmd *exec.Cmd, prefix string) error { + cmd.Env = append(cmd.Env, fmt.Sprintf("LAZYGIT_COLUMNS=%d", view.InnerWidth())) return gui.newCmdTask(view, cmd, prefix) }