Skip to content

core: add native split-footer commit path#890

Open
simonklee wants to merge 20 commits intomainfrom
flicker-less
Open

core: add native split-footer commit path#890
simonklee wants to merge 20 commits intomainfrom
flicker-less

Conversation

@simonklee
Copy link
Copy Markdown
Member

@simonklee simonklee commented Mar 29, 2026

Split-footer mode on main flushes captured stdout in TypeScript
before the native frame, producing a two-phase clear/repaint
flicker. The capture queue is coupled to the global console
singleton, so footer routing reacts to console writes even in
passthrough mode. And a bunch of TODO since this was mostly
a proof of concept.

Move split-footer ownership into native. A new SplitScrollback
model tracks published rows and tail column; the footer settles
downward as scrollback grows and pins at the bottom boundary.
Captured stdout and a new writeToScrollback() API both produce
OptimizedBuffer snapshots that the native side emits as styled
ANSI in one atomic output buffer alongside the footer repaint.

Centralize geometry clamping so footerHeight > terminalHeight
cannot produce negative renderOffset. Flush pending output
before resize, suspend, mode transitions, and destroy. Detect
the real cursor row at startup via CPR so the footer starts at
the actual position rather than row 1.

@simonklee simonklee changed the base branch from main to cli-render-api March 29, 2026 08:49
@simonklee simonklee changed the base branch from cli-render-api to main March 29, 2026 09:35
@simonklee simonklee marked this pull request as ready for review March 29, 2026 09:36
@simonklee simonklee changed the title Flicker less core: add native split-footer commit path Mar 30, 2026
@simonklee simonklee force-pushed the flicker-less branch 3 times, most recently from 4d7db9b to ab910d2 Compare April 2, 2026 11:54
simonklee added 17 commits April 2, 2026 20:35
Move split-footer stdout interception to a renderer-local queue and flush
pending output before switching to passthrough, so footer routing no longer
depends on shared console capture.

Centralize clamped split geometry, mode transitions, resize, and
test renderer setup.
Add a CliRendererConfig option, clearOnShutdown. When clearOnShutdown is
false, it skips region-clearing sequences.
Batch captured split-footer commits into a single synchronized render frame
and keep frame boundaries explicit with begin/finalize flags so we stop
re-toggling sync/cursor state per chunk. Restore bounded DECSTBM only when
pinned so appended output scrolls the upper pane instead of overwriting footer
rows, and add regression coverage plus demo stress controls to lock the
behavior in.
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