Directories as commands, and a directory alone changes to it; bjoterm 0.2.1

As fish does: the first word completes directories too, and an interactive
line that is only a directory (with a /, or . or ..) changes to it. Tab
lists the candidates when it can add nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Linus Björnstam 2026-12-01 14:01:43 +01:00
parent 61d5a96eda
commit e697166927
6 changed files with 42 additions and 9 deletions

View file

@ -68,6 +68,9 @@
(let ((c (complete sh "prevd")))
(Tuple (record-ref c candidates) (record-ref c descriptions)))
(Tuple ["prevd "] ["go back in the directory history; also Alt-Left"]))
(expect "and directories" (complete sh "ab")
(Completion (prefix "ab") (candidates ["abd/"]) (descriptions ["directory"])))
(expect "ignoring case" (cands "AB") ["abd/"])
(expect "a first word with a / completes files" (cands "./ab") ["./abc.txt " "./abd/"])
(expect "a path ignoring case when nothing else matches" (cands "./ABC") ["./abc.txt "])
(expect "each part as the start of a name" (cands "ls ./a/in") ["./abd/inner "])