Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refresh diff output on window resize#5297

Open
adamritter wants to merge 1 commit intojesseduffield:masterfrom
adamritter:refresh-diff-on-window-resize
Open

Refresh diff output on window resize#5297
adamritter wants to merge 1 commit intojesseduffield:masterfrom
adamritter:refresh-diff-on-window-resize

Conversation

@adamritter
Copy link

Summary

  • recalculate main diff content on window resize so formatting-sensitive pager output is regenerated
  • keep PTY resize behavior and then trigger content refresh for side/main contexts as needed
  • apply the same refresh behavior on Windows resize path

Testing

  • Tested only on macOS

@adamritter
Copy link
Author

adamritter commented Feb 21, 2026

Some context:

As you can see this is an AI generated fix of the feature request that really bothered me: I was using autoresizing terminals a lot (with zoom in/out keys) and the diff output looked very bad (especially with background colors of delta, where the lines became garbled).

I made a quick fix using Codex extra high, and tested that the bug fix works, but happy to improve on the code quality and understand it more (and going through the checklist) if that's needed / sufficient for including in lazygit.

@stefanhaller
Copy link
Collaborator

I can see how this is an improvement for the use case you describe (resizing terminals via keys). However, for continually resizing a window with the mouse it's not a good solution; see #4415 (comment).

@adamritter
Copy link
Author

I understand, it's your project / decision of course. Having a minimal 1s timeout after the refresh sounds like a good option for my type of case, or even just killing+restarting the diff thread, but I understand that you don't want to complicate the implementation, it's hard to maintain a project with so many features.

I saw on that other issue that it was frustrating experience for other people as well.

BTW I love Lazygit but I was missing being able to view the whole project (and I'm sure it's out of scope for your project), so I just vibe coded another called LazyViewer in the last few days:

https://github.com/adamritter/lazyviewer

Feel free to decide whatever you want with my feedback, and thanks for answering!

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