A thin Starship adapter for tmux that renders beautiful, customizable status bars.
Use the full power of Starship to style your tmux status bar, with automatic access to tmux session, window, pane, and client information as environment variables.
- Full Starship compatibility β Use any Starship module, prompt, or theme in your tmux status bar.
- Rich tmux context β Session, window, pane, and client variables are automatically injected as
TMUX_*environment variables. - Per-side configuration β Separate Starship configs for
status-left,status-right, andwindow-status(center). - Prefix highlighting β Style your status bar differently when the tmux prefix key is active.
- Zero boilerplate β No wrapper scripts or complex tmux format strings required.
cargo install tmuxshipcp examples/starship.toml ~/.tmux/starship.toml
cp examples/.right.toml ~/.tmux/.right.toml
cp examples/.center.toml ~/.tmux/.center.tomlAdd to ~/.tmux.conf:
setenv -g TMUX_SHIP_LEFT_CONFIG "$HOME/.tmux/starship.toml"
setenv -g TMUX_SHIP_RIGHT_CONFIG "$HOME/.tmux/.right.toml"
setenv -g TMUX_SHIP_CENTER_CONFIG "$HOME/.tmux/.center.toml"
run-shell 'tmuxship apply'tmux source ~/.tmux.confThe recommended way to use tmuxship is tmuxship apply, which runs once at startup and converts your Starship TOML styles into native tmux status-left, status-right, and window-status options. This is fast, flicker-free, and requires no background processes.
For segments that need live data (battery, git status, frequently updating clocks), you can fall back to runtime rendering with #(tmuxship <side>). This runs every status-interval, injects TMUX_* env vars, calls Starship, and converts ANSI colors to tmux format strings.
| Mode | When to use |
|---|---|
tmuxship apply (preferred) |
Colors, session name, window list, host β anything that changes on tmux events |
#(tmuxship <side>) |
Live data that changes outside of tmux (battery, git status, external APIs) |
You can mix both modes: use tmuxship apply for the frame, and override a single side with runtime rendering when needed.
| Command | Description |
|---|---|
tmuxship left |
Render the left status segment |
tmuxship right |
Render the right status segment |
tmuxship center |
Render the window status segment |
tmuxship full |
Render all segments |
tmuxship emit-tmux-conf |
Print the generated tmux config (dry-run) |
tmuxship apply |
Apply the generated config to the running tmux server |
tmuxship resolves Starship config files for each side (left, right, center) in the following order:
--configflagTMUX_SHIP_<SIDE>_CONFIGenvironment variable (e.g.TMUX_SHIP_LEFT_CONFIG)STARSHIP_CONFIG$XDG_CONFIG_HOME/tmux/.<side>.toml$XDG_CONFIG_HOME/tmux/starship.toml$XDG_CONFIG_HOME/starship/.<side>.toml$XDG_CONFIG_HOME/starship/starship.toml$HOME/.config/tmux/.<side>.toml$HOME/.config/tmux/starship.toml$HOME/.tmux/.<side>.toml$HOME/.tmux/starship.toml$HOME/.config/starship/.<side>.toml$HOME/.config/starship/starship.toml
set -g status on
set -g status-left-length 100
set -g status-right-length 200
set -g status-justify centre
set -g focus-events on
# Config paths for each status segment
setenv -g TMUX_SHIP_LEFT_CONFIG "$HOME/.tmux/starship.toml"
setenv -g TMUX_SHIP_RIGHT_CONFIG "$HOME/.tmux/.right.toml"
setenv -g TMUX_SHIP_CENTER_CONFIG "$HOME/.tmux/.center.toml"
setenv -g TMUX_SHIP_WINDOW_SEPARATOR " β’ "
# Generate status-left, status-right, and window-status options from Starship configs.
# Styles come from Starship TOML; tmux-native format strings (#S, #I, #W) render the values.
run-shell 'tmuxship apply'
# Refresh the status bar on relevant tmux events
set-hook -g client-session-changed 'refresh-client -S'
set-hook -g client-attached 'refresh-client -S'
set-hook -g pane-focus-in 'refresh-client -S'
set -g window-status-style "bg=default,fg=default"
# Default refresh interval (1 minute is plenty for static styling)
set -g status-interval 60Key points:
- Config paths are set once with
setenv -gand picked up automatically by tmuxship. tmuxship applygenerates tmux options from Starship custom module styles, keeping color definitions in TOML.- Runtime
#(tmuxship right)still injectsTMUX_*environment variables for shell-driven modules. - Keep
tmuxshipon yourPATH, or use an absolute path in your tmux config.
Some terminals or older tmux versions skip certain hooks. If your status bar feels stale on focus changes, uncomment these:
# Refresh on focus transitions
# bind-key -n FocusIn refresh-client -S
# bind-key -n FocusOut refresh-client -S
# Additional hooks (uncomment if needed)
# set-hook -g client-focus-in 'refresh-client -S'
# set-hook -g client-focus-out 'refresh-client -S'
# set-hook -g after-select-window 'refresh-client -S'
# set-hook -g after-new-window 'refresh-client -S'
# set-hook -g window-pane-changed 'refresh-client -S'
# set-hook -g window-layout-changed 'refresh-client -S'If you need live data that tmuxship apply cannot capture (battery, git status, etc.), override a specific side with runtime rendering:
set -g status-right '#(tmuxship right)'
set -g window-status-format '#(TMUX_SHIP_TARGET="#{window_id}" tmuxship center)'
set -g window-status-current-format '#(TMUX_SHIP_TARGET="#{window_id}" tmuxship center)'Set TMUX_SHIP_TARGET to a tmux format string like #{window_id} so tmuxship queries data for the correct window rather than the active one.
To inspect what tmuxship apply would generate before applying:
tmuxship emit-tmux-confRecognized custom module names for generated config:
prefix_activeandsession_normal(left config) β generatesstatus-leftaround tmux-native#Swindow_active,window_inactive,window_zoom(center config) β generates window status around#I,#W, and#{window_zoomed_flag}; separator text is controlled byTMUX_SHIP_WINDOW_SEPARATOR- Right config is always runtime-rendered as
#(tmuxship right)
Left: session name Β· Center: window list (active highlighted) Β· Right: time, host, window count
| Normal | Prefix active |
|---|---|
The session name is subtle in normal state and gets a bright green background when you press the tmux prefix key.
starship.toml (set via TMUX_SHIP_LEFT_CONFIG):
"$schema" = 'https://starship.rs/config-schema.json'
format = "$custom"
add_newline = false
# Shown when the prefix key is active
[custom.prefix_active]
when = 'test "${TMUX_CLIENT_PREFIX:-0}" = "1"'
command = 'printf "%s" "${TMUX_SESSION_NAME}"'
format = "[$output]($style) "
style = "bg:#95E6CB bold"
# Shown in normal state
[custom.session_normal]
when = 'test "${TMUX_CLIENT_PREFIX:-0}" != "1"'
command = 'printf "%s" "${TMUX_SESSION_NAME}"'
format = "[$output]($style) "
style = "fg:#565B66"| Active | Inactive | Zoomed |
|---|---|---|
Active windows get a bold, highlighted style. Inactive windows are muted. Zoomed windows show an indicator.
.center.toml (set via TMUX_SHIP_CENTER_CONFIG):
format = "$custom"
add_newline = false
[custom.window_active]
when = 'test "${TMUX_WINDOW_ACTIVE:-0}" = "1"'
command = 'printf "%s:%s" "${TMUX_WINDOW_INDEX}" "${TMUX_WINDOW_NAME}"'
format = "[$output]($style)"
style = "bg:#313244 fg:#CDD6F4 bold"
[custom.window_inactive]
when = 'test "${TMUX_WINDOW_ACTIVE:-0}" != "1"'
command = 'printf "%s:%s" "${TMUX_WINDOW_INDEX}" "${TMUX_WINDOW_NAME}"'
format = "[$output]($style)"
style = "fg:#6C7086"
# Optional: show an icon when the active window is zoomed
[custom.window_zoom]
when = 'test "${TMUX_WINDOW_ACTIVE:-0}" = "1" && test "${TMUX_WINDOW_ZOOMED_FLAG:-0}" = "1"'
command = 'printf "π"'
format = " $output".right.toml (set via TMUX_SHIP_RIGHT_CONFIG):
"$schema" = 'https://starship.rs/config-schema.json'
format = "$time$custom"
add_newline = false
[time]
disabled = false
format = "[$time]($style) "
style = "fg:#89B4FA"
time_format = "%H:%M:%S"
[custom.host]
when = "true"
shell = "bash"
command = 'printf "%s" "${TMUX_HOST_SHORT:-$(hostname -s)}"'
format = "on [$output]($style) "
style = "fg:#A6E3A1"
[custom.window_count]
when = "true"
shell = "bash"
command = 'printf "%s" "${TMUX_SESSION_WINDOWS}"'
format = "[σ°² $output]($style)"
style = "fg:#CBA6F7"Combine built-in Starship modules with custom tmux-aware modules for a rich left status.
advanced-left.toml:
"$schema" = 'https://starship.rs/config-schema.json'
format = "$custom$directory$git_branch$git_status"
add_newline = false
# Session name with prefix highlighting
[custom.session_prefix]
shell = "bash"
when = 'test "${TMUX_CLIENT_PREFIX:-0}" = "1"'
command = 'printf "σ° %s" "${TMUX_SESSION_NAME:-?}"'
format = "[$output]($style) "
style = "bg:#95E6CB fg:#1E1E2E bold"
[custom.session_normal]
shell = "bash"
when = 'test "${TMUX_CLIENT_PREFIX:-0}" != "1"'
command = 'printf "σ° %s" "${TMUX_SESSION_NAME:-?}"'
format = "[$output]($style) "
style = "fg:#565B66"
# Current directory (from the active pane's CWD)
[directory]
format = "[$path]($style) "
style = "fg:#89B4FA"
truncation_length = 3
truncate_to_repo = true
# Git branch
[git_branch]
format = "on [$symbol$branch]($style) "
symbol = ""
style = "fg:#A6E3A1"
# Git status indicators
[git_status]
format = '([\[$all_status$ahead_behind\]]($style) )'
style = "fg:#F9E2AF"See the examples/ directory for all available configuration samples.
All tmux variables are automatically injected into the Starship environment with a TMUX_ prefix.
| Variable | Description |
|---|---|
TMUX_SESSION_NAME |
Current session name |
TMUX_SESSION_ID |
Session ID |
TMUX_SESSION_CREATED |
Session creation timestamp |
TMUX_SESSION_ATTACHED |
Number of attached clients |
TMUX_SESSION_WINDOWS |
Number of windows |
| Variable | Description |
|---|---|
TMUX_WINDOW_ID |
Window ID |
TMUX_WINDOW_INDEX |
Window index |
TMUX_WINDOW_NAME |
Window name |
TMUX_WINDOW_ACTIVE |
1 if active, 0 otherwise |
TMUX_WINDOW_FLAGS |
Window flags |
TMUX_WINDOW_LAYOUT |
Window layout |
TMUX_WINDOW_PANES |
Number of panes |
TMUX_WINDOW_WIDTH / TMUX_WINDOW_HEIGHT |
Window dimensions |
TMUX_WINDOW_ZOOMED_FLAG |
1 if zoomed, 0 otherwise |
| Variable | Description |
|---|---|
TMUX_PANE_ID |
Pane ID |
TMUX_PANE_INDEX |
Pane index |
TMUX_PANE_TITLE |
Pane title |
TMUX_PANE_CURRENT_PATH |
Current working directory |
TMUX_PANE_CURRENT_COMMAND |
Running command |
TMUX_PANE_PID |
Process ID |
TMUX_PANE_WIDTH / TMUX_PANE_HEIGHT |
Pane dimensions |
TMUX_PANE_ACTIVE |
1 if active, 0 otherwise |
TMUX_PANE_AT_TOP / TMUX_PANE_AT_BOTTOM / TMUX_PANE_AT_LEFT / TMUX_PANE_AT_RIGHT |
Edge position flags |
| Variable | Description |
|---|---|
TMUX_CLIENT_PREFIX |
1 if prefix key is active, 0 otherwise |
TMUX_CLIENT_WIDTH / TMUX_CLIENT_HEIGHT |
Terminal dimensions |
TMUX_CLIENT_TERMNAME |
Terminal name |
| Variable | Description |
|---|---|
TMUX_HOST |
Full hostname |
TMUX_HOST_SHORT |
Short hostname |
By default, tmuxship fetches all common tmux variables. To reduce overhead, specify only the variables you need:
set -g status-left '#(TMUX_SHIP_TMUX_VARS="session_name,window_index" tmuxship left)'- tmux invokes tmuxship via
#(tmuxship left)(or another side). - tmuxship queries tmux and exposes variables as
TMUX_*environment variables. - Starship is executed with the resolved config file.
- ANSI color codes from Starship output are converted to tmux format strings.
- The result is written to stdout for tmux to render.
Contributions are welcome. Please see CONTRIBUTING.md for details.
cargo testScreenshots are generated from Starship ANSI output using ansisvg:
# Install ansisvg (requires Go)
go install github.com/wader/ansisvg@latest
# Generate screenshots from example configs
./scripts/generate-screenshots.shOutput SVGs are placed in screenshots/.
MIT