summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author尼诺 <ninuo@eastgarden.com>2023-11-22 10:18:19 +0800
committerStefan Haller <stefan@haller-berlin.de>2023-11-22 12:08:05 +0100
commit0f2b79a1d42c2d9f289353882aeb3cc883849fe9 (patch)
tree138086bdfd02c82a6ec3f25cbc520ee997dcff75
parentbb87642aee6bf6f599607e771d7a238a21eb4d81 (diff)
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.
-rw-r--r--pkg/gui/pty.go3
1 files changed, 2 insertions, 1 deletions
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)
}