Implement programmable prompt (issue #09)

Replace static _PROMPT/_PROMPT2 with dynamic __prompt(exitcode)/__prompt2(exitcode)
functions. Fallback chain: __prompt() → _PROMPT → "> ". Install a default __prompt
that shows the current directory with ~ abbreviation. Track last exit code from the
REPL loop and pass it to the prompt function.
This commit is contained in:
Cormac Shannon
2026-03-03 23:19:09 +00:00
parent bbc0f24009
commit e8756d5d78
3 changed files with 179 additions and 5 deletions

View File

@@ -1,7 +1,6 @@
# 09 — Programmable prompt
**Status:** open
**Blocked by:** #08
**Status:** done
Users should be able to customize the shell prompt by defining a Lua function, similar to how other shells use `PS1`/`PROMPT_COMMAND`/`precmd`.