Input Editor
The tsforge CLI uses an interactive multi-line input editor for the REPL session. It supports full keyboard navigation, history recall, word deletion, and multi-line paste.
Submit vs. newline
Section titled “Submit vs. newline”| Key | Behavior |
|---|---|
| Enter | Submit message to the agent |
| Shift+Enter | Insert newline in buffer |
| Alt+Enter | Insert newline in buffer |
\ then Enter | Insert newline (remove the trailing backslash) |
When you press Enter with an empty buffer or at the top level, your message is submitted. To write multiple lines, use Shift+Enter, Alt+Enter, or end a line with a backslash and press Enter.
Navigation and editing
Section titled “Navigation and editing”Motion
Section titled “Motion”| Key | Action |
|---|---|
| ←/→ | Move cursor left/right (one character) |
| Ctrl+← / Ctrl+→ | Move by word |
| Home / End | Move to start/end of current line |
| Ctrl+Home / Ctrl+End | Move to start/end of entire buffer |
| ↑/↓ | Recall input history (at buffer edges only) |
Deletion
Section titled “Deletion”| Key | Action |
|---|---|
| Backspace | Delete character before cursor |
| Delete | Delete character at cursor |
| Ctrl+W | Delete word before cursor |
| Alt+Backspace | Delete word before cursor (alias) |
| Ctrl+U | Delete to start of line |
| Ctrl+K | Delete to end of line |
Kill ring (copy/paste buffer)
Section titled “Kill ring (copy/paste buffer)”| Key | Action |
|---|---|
| Ctrl+Y | Yank (paste) last deleted text |
| Alt+Y | Yank-pop (rotate through deleted text) |
| Key | Action |
|---|---|
| Ctrl+_ (Ctrl+underscore) | Undo last change |
History navigation
Section titled “History navigation”When your cursor is at the top of the buffer (line 0, any column), press ↑ to recall the previous submitted message. When at the bottom (last line), press ↓ to scroll forward through history. The draft you were typing is preserved and restored when you exit history.
Multi-line paste
Section titled “Multi-line paste”Paste a block of text with your terminal’s paste (⌘V on macOS / Ctrl+Shift+V on Linux). The terminal delivers it as a bracketed paste. The pasted content lands in the buffer as-is and may span multiple lines; edit it like any buffer text. When you press Enter, the entire buffer (including pasted lines) is submitted as a single message.
Very large pastes are displayed as [paste #N +M lines] in the UI and expand to their full content when sent.
Attaching images
Section titled “Attaching images”Requires a vision capability configured. Three ways to attach an image; each is sent to the vision backend and its text description is folded into your message (the chat model stays text-only):
| Method | Action |
|---|---|
| Ctrl+V | Paste an image from the clipboard. A 📋 reading clipboard… hint shows during the read, then an [image #N] chip lands in the buffer. (Falls back to pasting clipboard text if there’s no image.) |
| Drag & drop | Drag an image file onto the terminal. It drops the path, which is attached on send. |
@ mention | @path/to/image.png: the picker lists image files too. When the project has a tsconfig.json, typing an identifier (e.g. @ITh) also surfaces workspace symbols — accept inserts @file:line as a steer-friendly anchor. Path queries (e.g. @src/) stay file-only. |
Why Ctrl+V, not ⌘V: the terminal emulator intercepts ⌘V and, for an image, hands the app nothing. A terminal program can only receive Ctrl+V (a real control byte). Identical images attached more than once are described once (no duplicate cost). See also generating images.
Command palette and file picker
Section titled “Command palette and file picker”| Key | Action |
|---|---|
/ | Open command palette (when buffer contains only /) |
@ | Open mention picker (when buffer contains only @) |
Typing / or @ followed by other text opens inline completion above the editor block. For @:
- Files — filter by path substring; accept inserts
@path(unchanged). - Symbols — when a
tsconfig.jsonis present and your query looks like an identifier (IThing,fetchUser), LSP workspace symbols appear alongside files; accept inserts@file:lineso you can steer the agent to a definition or use site. - Ranking — symbol prefix match, then file basename prefix, then substring matches (capped at 8 rows, same as files).
Withhold symbol search in the picker with TSFORGE_NO_LSP_TOOLS=1 (file-only behavior, same as eval/headless runs).
An @ mid-token (e.g. in an email address) does not open the picker — only @ at the start of the line or after whitespace does.
Gate rail steer
Section titled “Gate rail steer”When the right rail is on the Gate surface and focused, Enter on a selected error row inserts steer text into the prompt (fix <rule> at <file>:line) and returns focus to the editor — same handoff as accepting an @ symbol, but anchored on the gate error you picked.
Keyboard interrupt
Section titled “Keyboard interrupt”| Key | Action |
|---|---|
| Ctrl+C | Interrupt the current model run (does not exit the session) |
| Ctrl+D | Exit the CLI (on empty buffer only) |
Fallback: basic input mode
Section titled “Fallback: basic input mode”If the multi-line editor has compatibility issues, you can fall back to simple single-line (readline) input:
TSFORGE_BASIC_INPUT=1 tsforgeThis mode still accepts slash commands and works in pipes, but does not support Shift+Enter, multi-line paste, or kill-ring operations.
Terminal compatibility
Section titled “Terminal compatibility”The editor auto-detects your terminal’s keyboard encoding (Kitty CSI-u, xterm modifyOtherKeys, or legacy). Resizing your terminal window updates the editor immediately. On non-TTY streams (pipes, files, CI), the editor is automatically skipped and replaced by line-buffered stdin reading.