Skip to content

Expose full-screen invalidation for color-only redraws#802

Open
cjennings wants to merge 1 commit into
akermu:masterfrom
cjennings:expose-invalidate-all
Open

Expose full-screen invalidation for color-only redraws#802
cjennings wants to merge 1 commit into
akermu:masterfrom
cjennings:expose-invalidate-all

Conversation

@cjennings

Copy link
Copy Markdown

Summary

Add a native module binding, vterm--invalidate-all, that marks the whole
terminal grid invalid and redraws it immediately.

Motivation

vterm--redraw redraws only rows already marked invalid by libvterm. That is
efficient for normal terminal output, but it leaves no direct way for Elisp to
refresh the whole rendered grid when only Emacs-side face/color state changes.

This affects theme changes and other display-only color changes. In those
cases the terminal contents are unchanged, so libvterm has no damaged rows, but
the existing rendered text still uses colors resolved before the face change.
Users currently work around this by briefly changing the terminal size and
restoring it, because term_resize invalidates all rows.

Change

  • Add Fvterm_invalidate_all in the native module.
  • Bind it as vterm--invalidate-all.
  • Declare the function in vterm.el.

The implementation calls:

invalidate_terminal(term, 0, term->height);
term_redraw(term, env);

This exposes the existing full-grid invalidation path without requiring callers
to fake a resize.

Validation

  • cmake -S . -B build
  • cmake --build build

Both pass locally.

Related

@cjennings cjennings marked this pull request as ready for review May 25, 2026 18:18
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.

1 participant