Skip to content

feat(config): add autowrap setting; drop always-on full-repaint workaround - #115

Merged
hyldmo merged 1 commit into
mainfrom
hyldmo/autowrap-setting
Jun 19, 2026
Merged

hyldmo merged 1 commit into
mainfrom
hyldmo/autowrap-setting

Conversation

@hyldmo

@hyldmo hyldmo commented Jun 19, 2026

Copy link
Copy Markdown
Owner

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

export default defineConfig({
  autowrap: false, // disable host autowrap if you hit the sidebar smear
  processes: { /* … */ }
})

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 syncCell records the intended cell so the stray bytes never repaint until a full repaint. Tracked upstream (with the same ?7l fix proposed): anomalyco/opentui#1187.

Testing

  • bun test — 702 pass, 0 fail (3 new validator cases). typecheck / lint clean.
  • Verified live in a downstream repo: autowrap: false eliminates the smear; shell wrapping restored on exit.

🤖 Generated with Claude Code

…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
hyldmo merged commit 6a1ca82 into main Jun 19, 2026
2 checks passed
@hyldmo
hyldmo deleted the hyldmo/autowrap-setting branch June 19, 2026 11:06
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant