1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-06 03:53:59 +02:00

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.
This commit is contained in:
尼诺 2023-11-22 10:18:19 +08:00 committed by Stefan Haller
parent bb87642aee
commit 0f2b79a1d4

View File

@ -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)
}