Tab cycles through a menu of the candidates; bjoterm 0.2.2

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

View file

@ -65,7 +65,8 @@
"printf 'fromrc\\r'" "sleep 0.5"
"printf 'sleep 0.5 &\\r'" "sleep 0.3" "printf 'ec'" "sleep 1.5" "printf 'ho typed\\r'" "sleep 0.5"
"printf '/usr/\\r'" "sleep 0.3" "printf 'pwd\\r'" "sleep 0.3"
(str "printf 'ls " state "/tabs/a\\t'") "sleep 0.5" "printf '\\003'" "sleep 0.3"
(str "printf 'cd " state "/tabs/a\\t'") "sleep 0.5" "printf '\\t'" "sleep 0.3"
"printf '\\t\\r'" "sleep 0.3" "printf '\\r'" "sleep 0.3" "printf 'pwd\\r'" "sleep 0.3"
"printf 'cd /tmp\\r'" "sleep 0.3"
"printf \"PROMPT='<\\\\W \\$(echo s)>\\\\$ '\\r\"" "sleep 0.5"
"printf 'exit\\r'" "sleep 1"]
@ -82,8 +83,10 @@
(expect-true "with status 130" (string-contains? out "status 130"))
(expect-true "Ctrl-Z at the prompt does not stop the shell" (string-contains? out "\nalive\n"))
(expect-true "a directory alone changes to it" (string-contains? out "pwd\n/usr\n"))
(expect-true "Tab lists the candidates when it can insert nothing"
(and (string-contains? out "tabs/alpha/") (string-contains? out "tabs/apple/")))
(expect-true "Tab shows a menu of the candidates when it can insert nothing, without their directory"
(string-contains? out "\nalpha/ apple/"))
(expect-true "and Tab chooses them in turn"
(string-contains? out (str "\n" state "/tabs/apple\n")))
(expect-true "jobs in a pipe" (string-contains? out "jobs | g command\nsleep 30\n"))
(expect-true "history in a pipe, with this line last"
(string-contains? out "history | tl 1 | g line\nhistory | tl 1 | g line\n"))