dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
22.5k stars 376 forks source link

🐛 Width of code section of "git log -p" is limited to 80 chars #1788

Open Mmkldb opened 1 month ago

Mmkldb commented 1 month ago

The code section within the output of git log -p is limited to 80 characters: image

Is this a bug or misconfiguration?

th1000s commented 1 month ago

Delta uses the width reported by the terminal, that seems to fail here so the fallback value of 80 is used. Which terminal or terminal multiplexer are you using on what OS?

Mmkldb commented 1 month ago

I see .. I'm using Alacritty, starting a wsl1 on windows, there I use fish as the shell. Interestingly it is working fine with other commands, like git diff, git show and git blame. So there must be a little difference how git log -p is trying to fetch the width from the terminal application.

th1000s commented 1 month ago

Other commands work fine? git show HEAD (or git show HEAD | delta) uses the correct width, but git log -p HEAD [ | delta] does not (also when alternating between these commands repeatedly)? They all use the same terminal width logic. WSL1 not getting some terminal syscalls quite right isn't surprising, but this variation is :)