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
- π Broad Shell Support β Native support for 10+ shells including Bash, Zsh, Fish, PowerShell, Nushell, and more
- π― 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
Paneship supports 10+ shells including bash, zsh, fish, powershell, nushell, elvish, xonsh, tcsh, ion, and cmd.
Automatic Setup (Recommended)
Run the following command and restart your shell:
Example: paneship init zsh --onboarding or paneship init bash --onboarding
Manual Setup
Add the initialization script to your shell's configuration file:
Zsh / Bash
Add to ~/.zshrc or ~/.bashrc:
Fish
Add to ~/.config/fish/config.fish:
paneship init fish | source
PowerShell
Add to your $PROFILE:
Invoke-Expression (&paneship init powershell)
Nushell Add to your config:
paneship init nushell | save -f ~/.cache/paneship/init.nu
If error
mkdir ~/.cache/paneship
paneship init nu | save --force ~/.cache/paneship/init.nu
# Then add `source ~/.cache/paneship/init.nu` to your config.nu
Other Shells
Paneship also supports elvish, xonsh, tcsh, ion, and cmd. Use paneship init <shell> to generate the respective initialization scripts.
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 shell formatting
# 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 (or equivalent)
# Supports: bash, zsh, fish, powershell, nushell, elvish, xonsh, tcsh, ion, cmd
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:
- 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
- Right-side prompt support for Zsh and Fish
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!