feat: tab completion and history hints #1

Merged
Bingo merged 1 commit from frogwatcher/Lotus:feat/tab-completion into main 2026-10-30 09:49:51 +00:00
Contributor

Adds tab completion to Lotus for 26.10.2.

  • First word: completes builtins, aliases and programs on $PATH, labelled as builtin or alias. $PATH is rescanned every 30 s so new installs show up.
  • After that: completes file paths, with ~ expanded. A first word with a / (./run.sh, ~/bin/x) completes as a path.
  • Tab only: completion runs on Tab, not while typing, so nothing pops up uninvited.
  • History hints: previous commands show as a grey hint as you type. Press → to accept.
  • Ctrl-R: history search already worked, because it comes with prompt_toolkit, so nothing changed there.

Builtins and aliases are read on every completion, so reload and config changes are picked up straight away.

Tested: completer unit checks (he → help/head…, ll → alias, ls ~/thi → things, ./READ → README.md), and Lotus starts normally.

Not in this PR: src/lotus_shell/__pycache__/*.pyc files are tracked in git, so they show as modified after every run. A .gitignore with __pycache__/ would fix that. Happy to send that separately.

🤖 Generated with Claude Code

Adds tab completion to Lotus for 26.10.2. - **First word:** completes builtins, aliases and programs on `$PATH`, labelled as builtin or alias. `$PATH` is rescanned every 30 s so new installs show up. - **After that:** completes file paths, with `~` expanded. A first word with a `/` (`./run.sh`, `~/bin/x`) completes as a path. - **Tab only:** completion runs on Tab, not while typing, so nothing pops up uninvited. - **History hints:** previous commands show as a grey hint as you type. Press → to accept. - **Ctrl-R:** history search already worked, because it comes with prompt_toolkit, so nothing changed there. Builtins and aliases are read on every completion, so `reload` and config changes are picked up straight away. **Tested:** completer unit checks (`he` → help/head…, `ll` → alias, `ls ~/thi` → things, `./READ` → README.md), and Lotus starts normally. **Not in this PR:** `src/lotus_shell/__pycache__/*.pyc` files are tracked in git, so they show as modified after every run. A `.gitignore` with `__pycache__/` would fix that. Happy to send that separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Tab completes builtins, aliases and programs on $PATH for the first
word, and files after that. Completion only runs on Tab, not while
typing. Previous commands show as a grey hint (accept with →); Ctrl-R
history search already worked via prompt_toolkit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bingo merged commit 0145f56b7d into main 2026-10-30 09:49:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Nytrix-Labs/Lotus!1
No description provided.