Load ~/.config/lush/config and config.d/*.lua at REPL startup, respecting XDG_CONFIG_HOME. Suppressed by -E flag.
30 lines
1.1 KiB
Markdown
30 lines
1.1 KiB
Markdown
# 08 — Configuration support
|
|
|
|
**Status:** done
|
|
|
|
Users should be able to programmatically configure the shell at startup.
|
|
|
|
## Config location
|
|
|
|
- `~/.config/lush/config` — main config file (Lua script)
|
|
- `~/.config/lush/config.d/` — drop-in directory, files sourced in lexicographic order
|
|
|
|
## What can be configured
|
|
|
|
- **Prompt** — see #09
|
|
- **Aliases** — command aliases (e.g. `alias("ll", "ls -l")`)
|
|
- **Environment setup** — set/modify env vars at startup
|
|
- **Autocompletion rules** — TBD, mechanism for registering custom completions
|
|
|
|
## Startup behaviour
|
|
|
|
1. If `~/.config/lush/config` exists, execute it as a Lua script
|
|
2. If `~/.config/lush/config.d/` exists, execute each `.lua` file in lexicographic order
|
|
3. Config files run in the same Lua state as the interactive session — locals, globals, and env changes persist
|
|
|
|
## Open questions
|
|
|
|
- Should there be a system-wide config (`/etc/lush/config`) sourced before user config?
|
|
- What API surface to expose for autocompletion registration?
|
|
- Should config errors be fatal or just print a warning and continue?
|