Use Lua for Dynamic Configurations (.trushellrc) #85
ElianThorne
started this conversation in
Ideas
Replies: 2 comments
-
|
Sounds good |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Yeap, this is a great idea, go ahead! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions