A rewrite of Starship in more maintainable, idiomatic Rust.
This repo is meant to serve as a proof of concept for a new architecture for Starship. Nothing here is set in stone. It will serve as a way to share what I envision a future rewrite of Starship will look like.
👉 Comments and feedback are appreciated in Issues.
- Create daemon for plugin and config loading
- Use lua for programmatic configuration
- Have lua values use metamethods to query WASM plugin
- Use WASM for plugins
- Create plugin SDK for opinionated authoring and testing
- Have wasm bytecode compile to native and cached on disk
- Have modules generate lua types on load
- Budget: 16.67ms (60fps) or 8.33ms (120fps)
- Daemon responds to
ncfor other shell prompts to use:echo '{"pwd":"'$PWD'","user":"'$USER'"}' | nc -U ~/.config/starship/starship.sock - Have modules enable based on repo root
rootUsername = user.name == "root" and "root" or nil
-- git.branch calls the git plugin for the branch value
-- compact trims values that are nil
format = compact({ rootUsername, pwd, git.branch, "❯" })
-- the returned string is the output
return table.concat(format, " ")- Run the daemon:
cargo run --release -p starship-daemon
- Then run the prompt:
cargo run --release -p starship
Run them both with STARSHIP_PROFILE=1 to get runtime profiling metrics.