feat(input): readline keymap — Esc-clear + Ctrl-A/E/W/K/U (#29)

Implement the deferred I1b readline shortcuts in the command input
field (ADR-0049, closing issue #29):

  Esc      clear a partly-typed command (only when no completion memo)
  Ctrl-A   cursor to line start (Home alias)
  Ctrl-E   cursor to line end (End alias)
  Ctrl-W   delete the previous word (readline-style, UTF-8 safe)
  Ctrl-K   kill to end of line
  Ctrl-U   kill to start of line

Esc precedence is preserved: a live Tab-completion memo still wins
(Esc undoes the completion first, ADR-0022); Esc clears only when no
memo is alive. While a sidebar panel is focused (Ctrl-O), Esc exits
navigation mode upstream and never clears the input draft. Cursor-only
keys leave history navigation intact like Home/End; buffer-mutating
keys end it like Backspace.

New helpers clear_input / delete_prev_word / kill_to_end /
kill_to_start in src/app.rs. 22 new Tier-1 tests (2458 pass / 0 fail
/ 0 skip, clippy clean). ADR-0049 amends ADR-0046's OOS list;
requirements.md I1b marked done.
This commit is contained in:
claude@clouddev1
2026-06-12 22:12:08 +00:00
parent 862ab21202
commit 66c8bdaa65
5 changed files with 445 additions and 5 deletions
+10 -2
View File
@@ -147,11 +147,19 @@ since ADR-0027.)
cursor editing and is complete on its own terms; the separate
**multi-line** entry goal is tracked under I1, which is
genuinely not started.)*
- [ ] **I1b** Readline-style cursor shortcuts: Ctrl-A / Ctrl-E
- [x] **I1b** Readline-style cursor shortcuts: Ctrl-A / Ctrl-E
as aliases for Home / End for users on keyboards without those
keys (and for ergonomics in command-driven workflows). Likely
followed by Ctrl-W (delete previous word), Ctrl-K (delete to
end), Ctrl-U (delete to start). Pending.
end), Ctrl-U (delete to start).
*(Done 2026-06-12 — ADR-0049, issue #29: the full set —
Esc-clear + Ctrl-A/E/W/K/U — wired in `App::handle_key`
(`src/app.rs`) with helpers `clear_input` / `delete_prev_word`
/ `kill_to_end` / `kill_to_start`; Esc clears only when no
completion memo is alive (the memo wins first, ADR-0022);
cursor-only keys leave history navigation intact, kill keys
end it; 22 Tier-1 tests. On-screen advertisement of these keys
is issue #27's bottom-status-line work.)*
- [x] **I2** Persistent navigable input history (project-scoped).
*(Implemented across Iterations 2 + 6: per-command append to
`history.log` (Iter 2); on project open, the in-memory