feat: dynamic preview pane width based on terminal size#762
Merged
dlvhdr merged 13 commits intodlvhdr:mainfrom Feb 10, 2026
Merged
feat: dynamic preview pane width based on terminal size#762dlvhdr merged 13 commits intodlvhdr:mainfrom
dlvhdr merged 13 commits intodlvhdr:mainfrom
Conversation
dlvhdr
reviewed
Feb 7, 2026
Owner
dlvhdr
left a comment
There was a problem hiding this comment.
looks really good! thinking about it, should we change the default width to be
percenrage based? I'm not sure what's a better default
Co-authored-by: Dolev Hadar <6196971+dlvhdr@users.noreply.github.com>
Contributor
Author
I also think that something close to 50% could be a good starting point. I didn't want to impose my preferences but if we agree on this matter I can adjust the default. |
Owner
|
@trolleksii can we make it 0.45 as the default? |
Contributor
Author
|
Done |
dlvhdr
previously approved these changes
Feb 9, 2026
Contributor
Author
|
@dlvhdr can you please re-run the ci. I messed up test file when pulled main in and resolved conflicts in github ui 🤦 |
dlvhdr
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The preview pane width is currently configured as a static number. This works perfectly fine when terminal window size remains unchanged. However in cases where terminal window changes(eg tmux vertical splits, switching from the laptop screen to an ultra-wide external monitor, etc) the layout gets messed up which may be quite frustrating.
I attempted to add the capability to set preview pane width as a fraction. Now defaults.preview.width accepts floats where:
0 to 1 → treated as a fraction (e.g., 0.4 = 40% of terminal width)
Above 1 → converted to int and works as before (backward compatible)
Note: This is my first contribution to the project, so let me know if there's anything that should be adjusted to better match the overall architecture or coding conventions.
How did you test this change?
I added a couple of tests to cover the change plus manual testing.
Images/Videos
Example with with set to 0.45


Fullscreen:
With vertical split: