Skip to content

fix: redraw on terminal resize#102

Merged
RivoLink merged 1 commit intoRivoLink:mainfrom
andyraitra:fix/terminal-resize-redraw
May 8, 2026
Merged

fix: redraw on terminal resize#102
RivoLink merged 1 commit intoRivoLink:mainfrom
andyraitra:fix/terminal-resize-redraw

Conversation

@andyraitra
Copy link
Copy Markdown
Contributor

Closes #90

What changed

  • redraw the UI after a terminal resize, even if the content width stays the same

Why it changed

Before this change, resizing only the terminal height could leave the screen stale because redraw happened only when width changed.

How it was tested

  • env -u LEAF_EDITOR -u VISUAL -u EDITOR cargo test
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --release
  • ran cargo run -- TESTING.md
  • resized the terminal taller and shorter and checked that the UI updated correctly

Comment thread src/runtime.rs Outdated
if sync_render_width(terminal, app, ss, themes)? {
needs_redraw = true;
}
let _width_changed = sync_render_width(terminal, app, ss, themes)?;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just call sync_render_width directly.

@RivoLink
Copy link
Copy Markdown
Owner

RivoLink commented May 8, 2026

Hi @andyraitra,
Thanks for this PR 😉

I just have a few suggestions:

  • I think declaring the variable _width_changed is not required. Could you remove it and amend it in the same commit (to keep only one commit)?
  • The main branch only accepts signed commits, so if you can, I’d appreciate it if you signed the commit. If not, no worries, I’ll sign it myself while preserving you as the author.

GPG signing docs : https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

Thanks again for your interest!

@RivoLink
Copy link
Copy Markdown
Owner

RivoLink commented May 8, 2026

I did a merge, so you need to rebase on main as well.

@andyraitra andyraitra force-pushed the fix/terminal-resize-redraw branch from be91b7a to 71fd619 Compare May 8, 2026 18:00
@andyraitra andyraitra force-pushed the fix/terminal-resize-redraw branch from 71fd619 to 62418bf Compare May 8, 2026 18:07
@andyraitra
Copy link
Copy Markdown
Contributor Author

Done! Removed the _width_changed variable, rebased on main, and signed the commit.

@RivoLink RivoLink merged commit 26ff868 into RivoLink:main May 8, 2026
1 check passed
@RivoLink
Copy link
Copy Markdown
Owner

RivoLink commented May 8, 2026

Perfect, thank you 😊

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.

No resize on terminal resize

2 participants