Skip to content

Rewrite CLI REPL with scroll region UI and live steering#6

Open
pushkarsingh32 wants to merge 1 commit intoopen-gitagent:mainfrom
pushkarsingh32:feat/cli-repl-steering-ui
Open

Rewrite CLI REPL with scroll region UI and live steering#6
pushkarsingh32 wants to merge 1 commit intoopen-gitagent:mainfrom
pushkarsingh32:feat/cli-repl-steering-ui

Conversation

@pushkarsingh32
Copy link

Summary

  • Replace readline-based REPL with custom raw-mode terminal UI using ANSI scroll regions
  • Input line is always visible at the bottom while streaming output scrolls above
  • Users can type and send steer messages mid-stream without garbling output

Layout

Rows 1..(r-3)  — scroll region (streaming output)
Row  r-2       — queue line (pending steer message in yellow)
Row  r-1       — separator
Row  r         — input line with fake block cursor

Key changes

  • Always-on raw mode with manual keystroke handling (no readline)
  • Steer support: type during streaming, press Enter to send agent.steer()
  • Queue line shows pending steer message, echoes to scroll region when agent picks it up (appears after AI response ends, not inline with streaming text)
  • Hidden real cursor with inverse-video fake block cursor on input line
  • Proper vertical spacing between user messages and AI responses
  • Terminal resize handler redraws all fixed UI elements
  • Header line tracking prevents scroll region from overwriting startup info

Test plan

  • Build compiles clean
  • Manual test: typing during streaming shows on input line without garbling
  • Manual test: Enter during streaming sends steer, shown on queue line
  • Manual test: steer message appears in scroll region after AI's current response
  • Manual test: Ctrl+C aborts during streaming, exits when idle
  • Manual test: /quit, /memory, /skills commands work
  • Reviewer: test on different terminal sizes and emulators

Replace readline-based REPL with a custom raw-mode terminal UI
using ANSI scroll regions. The input line is always visible at the
bottom while streaming output scrolls above it.

Layout:
- Rows 1..(r-3): scroll region for streaming output
- Row r-2: queue line showing pending steer message
- Row r-1: separator
- Row r: input line with fake block cursor

Key changes:
- Always-on raw mode with manual keystroke handling
- Steer support: type during streaming, Enter sends agent.steer()
- Queue line shows pending steer in yellow, echoes to scroll region
  when agent picks it up (appears after AI response, not inline)
- Hidden real cursor with inverse-video fake cursor on input line
- Proper vertical spacing between messages
- Terminal resize handler redraws all fixed UI elements
@vercel
Copy link

vercel bot commented Mar 14, 2026

@pushkarsingh32 is attempting to deploy a commit to the shreyas-lyzr's projects Team on Vercel.

A member of the Team first needs to authorize it.

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