forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Context
Research into AIChat and Aider revealed both use an append-only output model with inline status indicators. No fixed panels, no scroll regions — just print to stdout and let the terminal scroll.
This issue tracks adopting those proven patterns after reverting the scroll region approach (#72).
Patterns to Adopt
From AIChat (Rust)
- Cursor position tracking: Use equivalent of
crossterm::cursor::position()to know terminal position - Explicit scroll:
ScrollUp/ScrollDowncommands when needed (not DECSTBM regions) - Atomic abort signals: Coordinate Ctrl+C across async operations
- REPL loop: Simple
read → process → output → repeatcycle
From Aider (Python)
- Streaming markdown: Full re-render at 8fps (alternative to our incremental approach if edge cases pile up)
- Visual separators: Horizontal rules between messages for readability
- Inline status: Print "Thinking..." or spinner inline, no fixed status bar
- Alt+Enter for multi-line: Toggle between single-line submit and multi-line editing
From blessed (reference only)
- CSR reset recipe (for future use if we ever need fixed panels):
- Set CSR:
\x1b[{top};{bottom}r - Position cursor inside bounds
- Insert/delete lines
- ALWAYS reset CSR:
\x1b[1;{height}r - Reposition cursor
- Set CSR:
Implementation
- Ensure output goes through simple
process.stdout.write()— no layout abstraction - Spinner renders inline (before streaming starts, cleared when first chunk arrives)
- Tool calls render inline with compact format (already done:
◇ bash git status→✓ bash) - Add horizontal rule separators between messages
- Status info (tokens, elapsed time) renders inline after response completes
- Input naturally at bottom (cursor ends up there after output)
Depends On
- [Architecture] oclite: Revert scroll region layout, adopt append-only output model #73 (revert scroll regions)
Acceptance Criteria
- Clean append-only output flow
- No ANSI scroll region sequences in codebase
- Spinner, tools, markdown all render inline
- Horizontal rules between messages
- oclite feels responsive and clean
Metadata
Metadata
Assignees
Labels
No labels