Skip to content

Fix lazygit diff pager width for delta#65

Open
michaelbarton wants to merge 1 commit intomasterfrom
claude/fix-lazygit-diff-pager-PbcuJ
Open

Fix lazygit diff pager width for delta#65
michaelbarton wants to merge 1 commit intomasterfrom
claude/fix-lazygit-diff-pager-PbcuJ

Conversation

@michaelbarton
Copy link
Owner

Summary

  • Switch lazygit pager config from legacy paging.pager to the modern pagers array format
  • Add --width={{columnWidth}} to the delta pager command so delta uses the lazygit panel width instead of the full terminal width
  • Fixes side-by-side diff rendering and prevents line wrapping/overflow in the lazygit diff panel

Problem

The previous config used delta --paging=never without passing the panel width. Delta would default to the full terminal width for rendering, but lazygit's diff panel is narrower than the terminal. This caused side-by-side diffs (enabled via [delta] side-by-side = true in gitconfig) to overflow and wrap incorrectly.

Additionally, paging.pager is the legacy config format. The modern pagers array format supports the {{columnWidth}} template variable and enables pager cycling with the | key.

Changes

# Before (legacy format, no width)
paging:
  colorArg: always
  pager: delta --paging=never

# After (modern format, correct panel width)
pagers:
  - pager: delta --paging=never --width={{columnWidth}}

Screenshot

Delta rendering in lazygit with the fix applied:

lazygit delta diff pager

References

Test plan

  • Open lazygit in a repo with unstaged changes
  • Verify delta renders diffs correctly in the diff panel
  • Verify side-by-side mode uses the correct panel width (no overflow/wrapping)
  • Try cycling pagers with the pipe key (new capability from pagers array format)

https://claude.ai/code/session_012caDs9Cg7i9JKrTeinxsKY

Switch from legacy paging.pager to the modern pagers array format and
pass --width={{columnWidth}} so delta renders diffs using the actual
lazygit panel width instead of the full terminal width. This fixes
side-by-side rendering and prevents line wrapping in the diff panel.

https://claude.ai/code/session_012caDs9Cg7i9JKrTeinxsKY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants