feat(config): add autowrap setting; drop always-on full-repaint workaround - #115
Merged
Merged
Conversation
…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>
|
🎉 This PR is included in version 2.18.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Supersedes the approach in #114 (merged).
Context
#114 forced a full repaint every frame to fix the render-drift smear (right-pane output bleeding into the tab sidebar; scrollbar dropping). That works, but it has a per-frame stdout cost. The cheaper alternative — disabling the terminal's autowrap — can't be on by default either: for non-grid output it risks long lines running off-screen, and it changes a global terminal mode. Neither belongs on by default.
What this does
App.forceFullRepaints()(the fix(ui): force full repaint at runtime instead of via bun patch #114 every-frame full repaint).autowrapconfig (defaulttrue= unchanged). Setautowrap: falseand numux disables the host terminal's autowrap (DECAWM,\x1b[?7l) on startup, restoring it (?7h) 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.
Behavior change⚠️
By default this removes the always-on smear fix #114 added. Out of the box the smear can recur (resize clears it, as before); users who hit it opt in with
autowrap: false. This is the deliberate "make it a setting for now" stance until the renderer is fixed upstream.Root cause / upstream
OpenTUI's incremental diff positions every run with an absolute cursor move and never relies on autowrap, but it never disables it and skips its right-edge cursor re-home to avoid tripping a wrap — so a run filling the last column wraps into column 1 of the next row, and
syncCellrecords the intended cell so the stray bytes never repaint until a full repaint. Tracked upstream (with the same?7lfix proposed): anomalyco/opentui#1187.Testing
bun test— 702 pass, 0 fail (3 new validator cases).typecheck/lintclean.autowrap: falseeliminates the smear; shell wrapping restored on exit.🤖 Generated with Claude Code