Context
Deep-dive research into 3 production terminal chat TUIs (AIChat/Rust, Aider/Python, blessed/Node.js) revealed that neither AIChat nor Aider uses ANSI scroll regions (DECSTBM). Both use a simple append-only stdout model where:
- Output prints to stdout, terminal scrolls naturally
- A dedicated line editor library owns input at the bottom (cursor is naturally there)
- No fixed panels, no scroll regions
Our scroll region layout (layout.ts, commit 4659b6c81) caused 3 critical bugs:
- Input frozen:
editor.render() never called after editor.handle() - Scroll region broken:
focusInput() writes outside scroll bounds (rows-1 vs rows-3) - Double prompt: Layout methods fighting for same screen lines
Plan
Revert commit 4659b6c81
This removes layout.ts and restores the working append-only architecture from before the scroll region attempt. Files affected:
layout.ts (delete — new file from that commit)index.ts (revert layout integration)spinner.ts (revert callback mode)
Verify after revert
Research Evidence
| Project | Uses DECSTBM? | Architecture |
|---|
| AIChat (Rust, 9.2k ⭐) | ❌ No | reedline + append stdout + cursor tracking |
| Aider (Python, 40.1k ⭐) | ❌ No | prompt_toolkit + append stdout + Rich Live rerender |
| blessed (Node.js) | ✅ Yes | But requires 16k+ LOC, double-buffer, 3-step CSR reset cycle |
Acceptance Criteria
Context
Deep-dive research into 3 production terminal chat TUIs (AIChat/Rust, Aider/Python, blessed/Node.js) revealed that neither AIChat nor Aider uses ANSI scroll regions (DECSTBM). Both use a simple append-only stdout model where:
Our scroll region layout (
layout.ts, commit4659b6c81) caused 3 critical bugs:editor.render()never called aftereditor.handle()focusInput()writes outside scroll bounds (rows-1vsrows-3)Plan
Revert commit
4659b6c81This removes
layout.tsand restores the working append-only architecture from before the scroll region attempt. Files affected:layout.ts(delete — new file from that commit)index.ts(revert layout integration)spinner.ts(revert callback mode)Verify after revert
Research Evidence
Acceptance Criteria
4659b6c81reverted cleanlybun run typecheckpassesbun testpasses