Discussed in #85
Originally posted by ElianThorne July 14, 2026
To compete with Bash, TruShell needs a configuration format that supports programming logic (like loops and if/else statements for dynamic prompts). Static formats like TOML or JSON won't cut it, and requiring users to compile Rust for basic config tweaks is impractical.
I propose embedding an ultra-fast, lightweight Lua engine into the core using the mlua crate.
Why Lua?
- Performance: Sub-millisecond execution with near-zero memory footprint. No startup lag.
- Simplicity: Clean syntax that is much easier to write than complex Bash scripting.
- Proven Model: This is the same architecture used by Neovim and Starship.
Example User Config (.trushellrc):
local user = trushell.get_user()
if user == "root" then
trushell.set_prompt("🔴 root -> ")else
trushell.set_prompt("🟢 user -> ")end
trushell.set_alias("ll", "ls -la")
Implementation Plan
We can isolate the integration to src/config/lua_bridge.rs where we handle bindings and safely catch script errors so user bugs don't crash the shell. This also creates straightforward tasks for new contributors to map basic Rust structs into Lua functions.
Let me know what you think.
Discussed in #85
Originally posted by ElianThorne July 14, 2026
To compete with Bash, TruShell needs a configuration format that supports programming logic (like loops and if/else statements for dynamic prompts). Static formats like TOML or JSON won't cut it, and requiring users to compile Rust for basic config tweaks is impractical.
I propose embedding an ultra-fast, lightweight Lua engine into the core using the mlua crate.
Why Lua?
Example User Config (.trushellrc):
Implementation Plan
We can isolate the integration to
src/config/lua_bridge.rswhere we handle bindings and safely catch script errors so user bugs don't crash the shell. This also creates straightforward tasks for new contributors to map basic Rust structs into Lua functions.Let me know what you think.