test-case: \C-n inserts ':norris ' at the cursor #39

Closed
opened 2026-05-13 04:20:37 +00:00 by claude-noether · 0 comments
Collaborator

Steps

  1. Boot aish (luajit main.lua).
  2. At the [aish:fast]> prompt, type nothing — just press Ctrl+N.
  3. Observe the buffer.
  4. Type find old log files and press Enter.

Expected

  • After Ctrl+N: prompt line shows [aish:fast]> :norris (cursor positioned after the space).
  • Continuing to type appends to the buffer normally.
  • Pressing Enter routes through the :norris <goal> meta handler — Norris banner appears.

What this exercises

  • ffi.readline.M.bind is correctly wired to GNU readline.
  • rl_insert_text + rl_redisplay cdefs work via FFI.
  • The Phase 1 status no-op handler was replaced by the real Phase 3 insert behavior.
  • The pin-for-lifetime invariant from R-C4 — no use-after-free on rebind.

Likely failure modes

  • Pressing Ctrl+N does nothing or prints garbage → readline rebind didn't take. Try rl_bind_keyseq return value check.
  • Pressing Ctrl+N inserts but display doesn't refresh → rl_redisplay() not wired or signature wrong.
  • Crash on \C-n press → ffi.cast aliasing issue (the R-C4 fix should prevent this).
## Steps 1. Boot aish (`luajit main.lua`). 2. At the `[aish:fast]>` prompt, type nothing — just press `Ctrl+N`. 3. Observe the buffer. 4. Type `find old log files` and press Enter. ## Expected - After Ctrl+N: prompt line shows `[aish:fast]> :norris ` (cursor positioned after the space). - Continuing to type appends to the buffer normally. - Pressing Enter routes through the `:norris <goal>` meta handler — Norris banner appears. ## What this exercises - `ffi.readline.M.bind` is correctly wired to GNU readline. - `rl_insert_text` + `rl_redisplay` cdefs work via FFI. - The Phase 1 status no-op handler was replaced by the real Phase 3 insert behavior. - The pin-for-lifetime invariant from R-C4 — no use-after-free on rebind. ## Likely failure modes - Pressing Ctrl+N does nothing or prints garbage → readline rebind didn't take. Try `rl_bind_keyseq` return value check. - Pressing Ctrl+N inserts but display doesn't refresh → `rl_redisplay()` not wired or signature wrong. - Crash on `\C-n` press → ffi.cast aliasing issue (the R-C4 fix should prevent this).
claude-noether added the test-case label 2026-05-13 04:20:37 +00:00
Sign in to join this conversation.