Skip to content

starship/starship-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starship Rewrite (proof of concept)

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.

Todos

  • 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 nc for other shell prompts to use: echo '{"pwd":"'$PWD'","user":"'$USER'"}' | nc -U ~/.config/starship/starship.sock
  • Have modules enable based on repo root

Example config

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, " ")

Contributing

  1. Run the daemon:
cargo run --release -p starship-daemon
  1. Then run the prompt:
cargo run --release -p starship

Run them both with STARSHIP_PROFILE=1 to get runtime profiling metrics.

About

Proof of concept for Starship rewrite

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

 
 
 

Contributors