line-read: suggestions, keys for the caller, initial input; 0.1.2

#:suggester shows a suggestion after the input, dimmed, as fish does. Right,
C-f, End and C-e at the end accept it; M-f, C-Right and M-Right one word.
#:command-key? hands keys to the caller as (LineKey key input), with the
input erased. line-read and simulate-line take #:initial.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Linus Björnstam 2026-12-01 13:07:56 +01:00
parent dc8a3325b8
commit 3021b14aac
7 changed files with 198 additions and 38 deletions

View file

@ -38,6 +38,7 @@
(match (line-read ed term (styled "λ> " [(StyleFg (Ansi 2)) StyleBold]) #:continuation (Some ".. "))
((LineText text) (println (str "read: " (written text))) (go))
(LineCancelled (go))
(LineEof unit)))
(LineEof unit)
((LineKey _ _) (go))))
(ignore (line-history-save ed history))
0)