Skip to content

Terminal Pager is blank when using delta as pager for git diff #11700

@fitzy1321

Description

@fitzy1321

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Zed Terminal Pager does not work with git-delta as a replacement for the default git diff pager. This tool works in Vscode Terminal, and all my other shells.

Steps to Reproduce:

  • Install delta
    • I used cargo install git-delta
    • Available in most package managers, install it
  • Use delta as pager in git conifg
  • Open a git repo in Zed
  • Make local changes to a file and save file
  • Enter git diff in Zed terminal

Expected Results:

  • Terminal should show delta style git diff, based on git config
    • Pager should "exit" early for short changes, i.e. no prompt or navigation needed because it fits on a "single page"
    • Longer changes should show diff and nav prompt, i.e. : at the bottom

Actual Results:

  • Terminal flashes for split second
  • Pager doesn't show any text
  • The only thing shown is the prompt at the bottom

I like to use delta, instead of the default pager, for my git diffs. I use it throughout my personal and professional dev envs, and it works well with other terminals and shells. But in Zed Terminal, when I enter git diff and delta is the pages in git config, the terminal goes blank. The only thing I can see is the : prompt at the bottom of the terminal.

The default git diff pager works in Zed Terminal.

I've used delta and my current config in Alacritty, Gnome Shell, Macos Terminal and iTerm, Kitty, and Vscode terminal without issues.

Not sure if it's relevant, but I use fish with starship.rs, instead of bash or zsh But the bug occurs in all 3 shells, and with or without starship shell active.

Config lives in git config file at ~/.config/git/config and looks like this:

[user]
	name = ...
	email = ...
[fetch]
	prune = true
[pull]
	ff = only
[init]
	defaultBranch = main

# delta config
# To Install: cargo install git-delta
[core]
	pager = delta
[delta]
	line-numbers = true
	file-style = bold yellow ul
	file-decoration-style = none
[interactive]
	diffFilter = delta --color-only

Environment

Zed: v0.134.4 (Zed)
OS: macOS 14.4.1
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

vscode example with delta
Screenshot 2024-05-11 at 7 58 03 AM

zed example with delta
Screenshot 2024-05-11 at 7 58 51 AM

zed example with default git config
image

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug[core label]gitGit integration feedbackterminalFeedback for terminal integration, shell commands, etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions