Interactive TUI
term2’s interactive interface combines an input composer with real-time streaming, collapsible tool calls, and unified diff previews.
The Prompt Composer
Section titled “The Prompt Composer”The composer supports multiline input, path completion, and command triggers:
- Multiline text: Press
Enterto submit. In multi-line mode, paste or insert newlines as needed. - File & Path completion (
@): Type@anywhere in the composer to open the interactive path completion menu. Search for files in the repository and pressEnterto insert the path into your prompt. - Direct Shell Execution (
!): When the composer is empty, type!to enter direct shell mode. The prompt turns red (!). The command executes directly in your shell and its output is captured into the conversation. To exit shell mode, pressBackspaceon an empty line or pressEscape. - Slash Commands (
/): Type/to open the slash commands menu with autocompletion.
Mid-Turn Prompt Queueing & Steering
Section titled “Mid-Turn Prompt Queueing & Steering”While the agent is actively executing a turn (generating responses or executing tools):
- Steering (
Enter): Type an instruction and pressEnter. This delivers a real-time steering message at the next request boundary, redirecting the agent without restarting the turn. - Queueing Follow-Up Prompts (
Alt+Enter/Esc+Enter): PressAlt+Enter(orEscfollowed byEnter) to queue instructions to run after the active turn finishes. - Queue Editing: When prompts are queued:
- Press
Uparrow while the input is empty to navigate queued items. - Press
eorEnterto pull a queued item back into the editor for revision. - Press
dto delete / retract a queued item. - Press
Escapeto cancel queue inspection.
- Press
Interrupting In-Flight Generation
Section titled “Interrupting In-Flight Generation”To safely interrupt a turn:
- Press
Escapetwice (Double Escape) while the composer is empty. - The first Escape arms the interrupt and displays a confirmation hint; the second Escape within 2 seconds cancels generation and stops any running foreground commands.
- If the composer contains uncommitted text, the first Escape clears the composer buffer instead.
Tool Approvals & Diffs
Section titled “Tool Approvals & Diffs”When the agent attempts to modify a file or run a command:
- Diff Previews: File changes show standard unified diff previews with added and removed lines.
- One-Key Decisions: Press
yto approve,nto reject. - Rejection Reasons: Pressing
nprompts for an optional rejection reason (Why?), allowing you to explain why the action was rejected so the agent can adapt.