fix(ui): force full repaint at runtime instead of via bun patch - #114
Merged
Merged
Conversation
Replaces the bun patch from #113. patchedDependencies is a root-project field — it does not propagate to projects that install numux as a dependency, so the patch fixed only numux's own dev runs, not consumers (a downstream repo on numux@2.17.2 still ran vanilla OpenTUI and saw the drift). Move the same fix into app code so it ships in numux's bundle. App.forceFullRepaints() registers a frame callback that re-raises the renderer's forceFullRepaintRequested flag every frame, forcing a full repaint instead of the incremental cell-diff that desyncs from the host terminal's cursor (sidebar smear / scrollbar drop). Frame callbacks run before the native render reads the flag and only on demand-driven frames (no idle cost); composition stays dirty-tracked. Guarded with a log warning if the flag ever disappears upstream. Removes patchedDependencies and the patch file. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🎉 This PR is included in version 2.17.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
hyldmo
added a commit
that referenced
this pull request
Jun 19, 2026
…round #114 forced a full repaint every frame to fix the render-drift smear (right-pane output bleeding into the tab sidebar). That carries a per-frame stdout cost, and disabling autowrap unconditionally risks off-screen clipping for some output — so neither belongs on by default. Replace it with an opt-in `autowrap: false` config: numux disables the host terminal's autowrap (DECAWM, ?7l) on startup and restores it on exit. Pane content still wraps inside its own VT grid; only the host emit-cursor wrap (which OpenTUI never relies on) is turned off. Default leaves autowrap enabled — today's behavior, no smear fix imposed. The proper fix is upstream (anomalyco/opentui#1187): OpenTUI positions every run absolutely and can disable autowrap itself, like vim/tmux. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hyldmo
added a commit
that referenced
this pull request
Jun 19, 2026
…round (#115) #114 forced a full repaint every frame to fix the render-drift smear (right-pane output bleeding into the tab sidebar). That carries a per-frame stdout cost, and disabling autowrap unconditionally risks off-screen clipping for some output — so neither belongs on by default. Replace it with an opt-in `autowrap: false` config: numux disables the host terminal's autowrap (DECAWM, ?7l) on startup and restores it on exit. Pane content still wraps inside its own VT grid; only the host emit-cursor wrap (which OpenTUI never relies on) is turned off. Default leaves autowrap enabled — today's behavior, no smear fix imposed. The proper fix is upstream (anomalyco/opentui#1187): OpenTUI positions every run absolutely and can disable autowrap itself, like vim/tmux. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Follow-up to #113. #113 doesn't reach consumers —
patchedDependenciesis a root-project-only field, so thebun patchfixed only numux's own dev runs. A downstream repo onnumux@2.17.2still ran vanilla OpenTUI and saw the drift until its bundle was hand-edited. This moves the same fix into app code so it ships in numux's bundle and reaches every consumer.What changed
App.forceFullRepaints()— registers an OpenTUI frame callback that re-raisesforceFullRepaintRequestedevery frame, so each render is a full repaint instead of the incremental cell-diff that desyncs from the host terminal's cursor (ambiguous-width glyphs / autowrap / emulator quirks → pane output smears into the sidebar, scrollbar drops).patchedDependencies+patches/@opentui%2Fcore@0.4.1.patchfrom fix(ui): force full repaint every frame to fix render drift #113.Frame callbacks run before the native render reads the flag, and only on demand-driven frames.
Why this propagates and the patch didn't
bun patch(#113)bun run devin a repo that installs numuxdist/bin.js@opentui/coreupgradelog()warning if flag renamedPerformance (unchanged from #113's analysis)
Composition stays dirty-tracked; only the buffer→stdout emit grows. Idle = zero cost (demand-driven). FPS-capped at
targetFps(30). Sustained-output worst case ≈ a few hundred KB/s up to ~1.5 MB/s for a large screen — same class ascat-ing a file; the extra parse load is on the emulator, not numux. Only bites on remote/SSH.Caveats
log()warning so it fails safe if the flag ever disappears.Testing
bun test— 699 pass, 0 fail.typecheck/lintclean.🤖 Generated with Claude Code