Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
2906380
docs(editor): design spec for the multi-line input editor
agjs Jun 26, 2026
dd17751
docs(editor): implementation plan for the multi-line editor (11 tasks…
agjs Jun 26, 2026
2b8eee1
feat(editor): EditorBuffer core text model (grapheme-aware insert/new…
agjs Jun 26, 2026
681e7cf
feat(editor): word/line/doc navigation + sticky-column vertical moves
agjs Jun 26, 2026
e3ad37d
feat(editor): kill-ring + word/line/to-edge deletes with yank/yank-pop
agjs Jun 26, 2026
3a2c786
feat(editor): coalesced undo/redo
agjs Jun 26, 2026
7da333a
fix: yank produces single undo snapshot, not double
agjs Jun 26, 2026
dd4c346
feat(editor): large-paste markers with expand-on-submit
agjs Jun 26, 2026
f013837
feat(editor): key decoder (Kitty CSI-u + modifyOtherKeys + legacy, En…
agjs Jun 26, 2026
6fc045d
feat(editor): finalize PasteScanner (timeout valve + tmux CSI-u decode)
agjs Jun 26, 2026
07e082f
chore(editor): move paste.ts under editor/ (consistent module layout)
agjs Jun 26, 2026
386829b
feat(editor): EditorView multi-line renderer (wrap + scroll + cursor)
agjs Jun 26, 2026
9116bb4
fix(editor): resolve row counting and cursor offset bugs
agjs Jun 26, 2026
fda7204
feat(editor): EditorController (raw stdin glue, submit/newline/paste …
agjs Jun 26, 2026
d7636be
feat(cli): drive the interactive prompt through the multi-line editor…
agjs Jun 26, 2026
f3d7030
fix(editor-cli): fix dual stdin/raw-mode conflict + history/Ctrl-C/pa…
agjs Jun 26, 2026
4e16b5b
fix(repl): reduce cognitive complexity + add editor controller tests
agjs Jun 26, 2026
61d57e9
docs(editor): document the multi-line input editor + keys
agjs Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/docs/src/content/docs/cli/interactive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The **CLI** is the main way you use tsforge. **REPL** mode means an interactive

Most users run `tsforge` and stay in the interactive session.

**Note:** See [Input Editor](/reference/input-editor/) for keyboard shortcuts, multi-line paste, and history navigation.

## Modes

| Mode | How | When |
Expand Down
89 changes: 89 additions & 0 deletions apps/docs/src/content/docs/reference/input-editor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Input Editor
description: Multi-line input editor keybindings, paste handling, and fallback mode.
---

The Dreamdata Platform's 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Correct the copy-paste brand reference from 'The Dreamdata Platform's CLI' to 'The tsforge CLI'.

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

| 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

### 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
| 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)
| Key | Action |
| --- | --- |
| **Ctrl+Y** | Yank (paste) last deleted text |
| **Alt+Y** | Yank-pop (rotate through deleted text) |

### Undo
| Key | Action |
| --- | --- |
| **Ctrl+_** (Ctrl+underscore) | Undo last change |

## 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

Paste a block of text with Ctrl+V (or ⌘V on macOS). The pasted content lands in the buffer as-is and may span multiple lines. You can 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.

## Command palette and file picker

| Key | Action |
| --- | --- |
| **`/`** | Open command palette (when buffer contains only `/`) |
| **`@`** | Open file picker (when buffer contains only `@`) |

Typing `/` or `@` followed by other text inserts those characters normally.

## 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

If the multi-line editor has compatibility issues, you can fall back to simple single-line (readline) input:

```bash
TSFORGE_BASIC_INPUT=1 tsforge
```

This mode still accepts slash commands and works in pipes, but does not support Shift+Enter, multi-line paste, or kill-ring operations.

## 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.
Loading
Loading