Paneship
A high-performance shell prompt written in Rust, optimized for tmux environments, large Git repositories, and developers who value speed and clarity.
Demo
Overview
Paneship is a fast, modern shell prompt that displays essential workspace information at a glance. With a persistent background daemon, asynchronous metadata updates, and an optimized socket-based rendering pipeline, it renders in ~1.5ms on averageβenabling snappy shell interactions without sacrificing functionality.
Key Metrics
- Average render time: ~1.5ms per prompt
- Performance: Up to ~10x faster than comparable alternatives
- Daemon-side rendering: Client-only overhead is minimal (~0.5ms socket call)
- Async Background Refreshes: Git and metadata updates never block your prompt
- Smart Invalidation: Triggered by Git HEAD changes and shell exit codes
Features
- β‘ Ultra-fast rendering β ~1.5ms average by offloading all logic to a persistent background daemon
- π Async Background Worker β Heavy operations (Git status, language versions) run in a separate thread and never block the renderer
- π― Tmux-aware β Automatic pane width detection, responsive truncation, and zero-lag cross-pane cache sharing
- π§ Rich Git integration β Branch display and file counts using
gix, with smart refreshes on commit/branch switch - π’ Language & Metadata β Automatic detection for Rust, Node.js, Python, Go, and more; version info is fetched asynchronously
- β±οΈ Command timing β Shows last command duration in human-readable format (ms/s/m)
- ποΈ Fully customizable β Simple TOML config for colors, icons, and layout
- π Safe & Efficient β Written in Rust with a minimal resource footprint and system allocator for fast startup
Quick Start
Installation
Install the latest release from crates.io:
Or build from source:
Setup
Zsh (Recommended)
Add the following line to your ~/.zshrc:
Then restart your shell:
Or reload your configuration:
Other Shells
Support for Bash, Fish, and other shells is planned. For now, you can manually integrate Paneship by:
- Setting your prompt variable to call
paneship render - Capturing the last command exit code
- (Optional) Setting
COLUMNSto your terminal width for responsive layout
Example for Bash (basic setup):
PROMPT_COMMAND='PROMPT="$(paneship render --exit-code $? --width $COLUMNS)"'
Prompt Layout
Paneship displays a two-line prompt:
ο» ~/.../paneship ξ main ~2 Β· π¦ v1.0.0 π¦ 1.95.0 σ° 11ms σ°₯ 20:56
β―
Line 1 Breakdown
Left side (Context):
- Directory: Project-aware path truncation (shows repository root + relative path)
- Git branch: Current branch name with icon
- Git status: Icons for staged (
+), unstaged (~), and untracked (?) changes - Package version: Extracted from Cargo.toml, package.json, pyproject.toml, etc.
Right side (Metadata):
- Language & version: Detected language with runtime version (e.g.,
π¦ Rust 1.75) - Command duration: Time taken by the last command (e.g.,
σ° 125ms) - Current time: HH:MM format
Line 2
A single cursor character (customizable via config).
Configuration
Paneship reads its configuration from ~/.config/paneship/config.toml. If no config file exists, sensible defaults are used.
Example Configuration
[]
= "π"
= 3
= true
[]
= ""
= "+"
= "~"
= "?"
[]
= "β―"
= "β―"
[]
= "2;37"
= "1;32"
[]
= "π¦"
= "1;33"
[]
= "β¬’"
= "1;32"
Configuration Options
Directory
iconβ Symbol displayed before the directory path (default:""βfolder icon)truncation_lengthβ Number of path components to show before truncating (default:3)truncate_to_repoβ Show only repository name + truncated path inside repos (default:true)
Git
branch_iconβ Symbol before branch name (default:"")staged_iconβ Symbol for staged changes (default:"+")unstaged_iconβ Symbol for unstaged changes (default:"~")untracked_iconβ Symbol for untracked files (default:"?")
Status
success_iconβ Cursor symbol for successful exit (default:"β―")failure_iconβ Cursor symbol for failed exit (default:"β―")
Metadata
time_colorβ ANSI color code for time display (default:"2;37")paneship_colorβ ANSI color code for metadata (default:"1;32")languages.<name>β Language-specific configuration (icon and color)
Architecture
Daemon-Driven Model
Paneship uses a client-daemon architecture to achieve sub-millisecond responsiveness:
- Thin Client: The
paneship rendercommand is a lightweight binary that merely sends your current context (CWD, exit code, width) to the daemon via a Unix socket. - Persistent Daemon: A background process (
paneship daemon) maintains an in-memory cache and performs all rendering logic. - Background Worker: A dedicated thread in the daemon handles "heavy" tasks (like running
node -vorgix status). - Instant Response: The daemon always returns the best available cached data immediately. If the data is stale (e.g., you just changed branches), it triggers a background refresh for the next prompt.
Performance Optimizations
- Socket-Based Rendering β The client does zero repository discovery or filesystem walking.
- Smart Invalidation β The daemon monitors Git
HEADand shell exit codes to know when to refresh data. - System Allocator β Optimized for fast process startup times.
- Zero-Recursion β Advanced process detection prevents redundant socket calls during background updates.
Commands
Rendering
# Render prompt with current context
# Render with specific exit code
# Render for custom directory
# Render with custom terminal width
# Render with command duration
Initialization
# Print shell initialization script for eval
# Append initialization to ~/.zshrc (interactive setup)
Daemon Management
# Start background daemon
# Check if daemon is running
Benchmarking
# Run benchmark (150 iterations, 4 concurrent panes)
# Compare against Starship
Development
Build
Test
Lint
Benchmark
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details on how to get started, report bugs, and submit pull requests.
Roadmap
Potential features and improvements:
- Bash and Fish shell support
- Windows terminal support (partial Rust support exists)
- Nix shell integration
- User-defined prompt modules via plugins
- Integration with system package managers for language detection
- VSCode integrated terminal support
- Performance profiling mode for debugging slow prompts
Troubleshooting
Prompt not updating
Check if the daemon is running:
If it's not, manually start it:
&
High CPU usage
- Verify Git repository health with
git fsck - Check if language detection is slow (profile with
paneship render --cwd <path>) - Increase cache TTL in
~/.config/paneship/config.tomlif working in large monorepos
Incorrect directory display
Ensure truncate_to_repo is set appropriately in your config. If set to true, only the repository name and relative path are shown. Set to false to show your full home-relative path.
Performance Comparison
On a mid-sized Rust repository (500+ dependencies):
| Prompt | Avg Render Time |
|---|---|
| Paneship (Daemon) | ~1.5ms |
| Paneship (Cold/No Daemon) | ~35ms |
| Starship | ~15ms |
| Oh My Zsh | ~150ms+ |
Benchmarks run on a 2021 MacBook Pro; results vary by system and repository size.
License
Licensed under the MIT License. See LICENSE for details.
Acknowledgments
- Built with Gitoxide (gix) for fast Git operations
- Unicode width handling via unicode-width
- Configuration via TOML
- Serialization via bincode
Support
For questions or discussions, feel free to:
- Open a GitHub Discussion
- File an issue
- Check existing documentation and examples
Paneship: Fast, focused, productive. Happy coding!