Repository navigation
Closed
Labels
Milestone
Description
Priority: P1 | Area: area:runtime | Labels: fix,P1,area:runtime,area:panel | Milestone: v0.1.0 | RFC: OQ-007 | Task: CTX-1783
Summary
When dragging a split-panel divider (update_border_drag) with inline primary-screen TUIs running in both panes (such as agy rendering via DECSET 2026 synchronized updates, CUU, ED 0, and trailing CR):
- Inline widget rows soft-wrap into multiple physical rows on width shrink:
State::resize_with_reportrewraps active inline widget rows (────horizontal borders,>prompt, and full-width status bar) into 2+ physical rows whennew_cols < old_cols, while the inline TUI'sSIGWINCHredraw (\x1b[<n>A\x1b[J) steps up by its logical widget height (1row per widget line), stranding duplicate────────borders and truncated status-bar fragments above the widget on every width-shrink step.
- In-flight DECSET 2026 synchronized frames formatted for the previous width auto-wrap on a narrowed grid:
- During continuous mouse border drags, a
?2026h ... ?2026lsynchronized frame rendered by the TUI for widthW_1can arrive after the grid has already narrowed toW_2 < W_1. Auto-wrapping the overflow onto a new row scrolls the primary screen up and leaves the trailing\rparked on the continuation row while the TUI's internal cursor remains at(x = 0, y = 0).
- During continuous mouse border drags, a
- Cursor offset mapping on soft-wrapped continuation rows maps
ccol == 0(after\r) toseg_start % new_cols != 0:- Subsequent width resizes map
unit_offset = seg_startto a non-zero column (e.g.col = 3after"edi"), so the next\x1b[J(emitted without a redundant\rbecause the TUI believes its cursor is already at column 0) erases only fromcol = 3onward and prints"esc to cancel..."atcol = 3, producing"ediesc to cancel..."and"AI: Out of creesc to cancel"staircasing across the pane.
- Subsequent width resizes map
Fix
- Track the active inline TUI viewport top row (
inline_top_row) on the primary screen across DECSET 2026 synchronized updates, upward cursor motions, carriage-return in-place redraws, andED 0erases (invalidated on unsynchronized linefeeds and full clears/resets), and resize active inline widget rows 1-to-1 in place (truncate_or_pad_one_logical) while continuing to reflow committed history lines and scrollback aboveinline_top_rowlosslessly. - Clip horizontal overflow at the right margin during active primary-screen synchronized TUI frames (
?2026h) instead of soft-wrapping and scrolling the viewport, and unwind any pre-existing soft-wrapped continuation chain at column 0 onED 0(\x1b[J). - Preserve column 0 when mapping the cursor across width resizes on inline/carriage-returned rows.
Activity
[CTX-1783] fix(term-state): scope inline-TUI resize clipping to stale…
[CTX-1783] fix(term-state): keep inline viewport top on ED 1, bound s…