From 0f2b79a1d42c2d9f289353882aeb3cc883849fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=BC=E8=AF=BA?= Date: Wed, 22 Nov 2023 10:18:19 +0800 Subject: Use a PTY when calling external diff command This is important for communicating the view size to the external command. e.g. The columns in difft's side-by-side mode are aligned correctly. --- pkg/gui/pty.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/gui/pty.go b/pkg/gui/pty.go index fe53697c8..3f59373b7 100644 --- a/pkg/gui/pty.go +++ b/pkg/gui/pty.go @@ -45,8 +45,9 @@ func (gui *Gui) onResize() error { func (gui *Gui) newPtyTask(view *gocui.View, cmd *exec.Cmd, prefix string) error { width, _ := gui.Views.Main.Size() pager := gui.git.Config.GetPager(width) + externalDiffCommand := gui.Config.GetUserConfig().Git.Paging.ExternalDiffCommand - if pager == "" { + if pager == "" && externalDiffCommand == "" { // if we're not using a custom pager we don't need to use a pty return gui.newCmdTask(view, cmd, prefix) } -- cgit v1.2.3