zed
zed copied to clipboard
Terminal Pager is blank when using `delta` as pager for `git diff`
Check for existing issues
- [X] 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
- I used
- 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
zed example with delta
zed example with default git config
If applicable, attach your ~/Library/Logs/Zed/Zed.log
file to this issue.
I just updated Zed and did a fresh install of delta, still using cargo.
The diff now appears, but looks like some color strings are showing too?
I'm experiencing this as well, albeit with different config for delta. I don't get the diff at all; just the color strings.
Looks like a bug introduced into delta
. Relevant issue
Adding this line to my git config fixed this issue for me, as suggested in the linked issue here.
[core]
pager = delta --dark
And it doesn't seem to negatively impact my other shells / terminals as well 👍