From 37184044609997604bfa1ab08be356d8b4e5e19d Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 15 Nov 2026 15:07:45 +0100 Subject: Input editor: history, bracketed paste, in-line editing - crossterm raw mode only for the duration of a prompt, so SIGINT keeps working during a turn - persisted history with prompt commands excluded and newlines escaped - bracketed paste inserts one multi-line buffer instead of firing N turns - ctrl-a/e/u/k/w editing, ctrl-c abandons the line, ctrl-d exits - ctrl-j submits, so pipes and pty harnesses work - width fallback: a 0-column pty is 80 columns, not 1 --- docs/PLAN.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'docs') diff --git a/docs/PLAN.md b/docs/PLAN.md index 75fd25b..9be54fa 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -127,6 +127,23 @@ turn that failed after writing its prompt can be resumed without editing the transcript; and `deepseek-v4.1-flash` accepted a 500k-token prompt, so the context ceiling is far higher than the 128k the plan assumed. +**M7 — Input editor.** ✅ Done. + +Replaces plain `read_line` behind the same seam. `crossterm` raw mode is enabled +only while a prompt is being read, so Ctrl-C during a turn is still a signal and +the double-Ctrl-C exit keeps working. + +- Up/down history, persisted to `~/.local/share/agent686/history`, capped at 200 + entries, with prompt-mode commands excluded and newlines escaped per record. +- Bracketed paste arrives as one block, including newlines: pasting a stack trace + is one prompt, not thirty. +- Editing: left/right/home/end, backspace/delete, ctrl-a/e/u/k/w. Ctrl-C abandons + the line, Ctrl-D exits. Ctrl-J submits too, so pipes and test harnesses work. +- Redraw moves up by the number of rows the previous buffer occupied, which + needed a correct terminal width: a pty that reports 0 columns is treated as 80, + not as 1 (treating it as 1 made every character wrap onto its own line). +- Non-TTY stdin still falls back to plain line reading. + ## Acceptance test (v1) > "Make a simple calculator in C" — run on the i386 box, from an empty directory. -- cgit v1.2.3