A powerful plugin for customizing tmux window tabs (window-status) with colors, icons, and advanced formatting.
tmux-tabicon is a plugin that enables advanced customization of tmux window tabs (window-status). It allows you to:
- Apply automatic or conditional colors to tabs
- Add icons to tabs
- Customize the appearance of active and inactive tabs
- Apply special formatting to first and last tabs
- Create session-specific themes
Add the following to your ~/.tmux.conf:
# Set the themes directory (create this directory if it doesn't exist)
set -g @tmux-tabicon-themes-dir "~/.config/tmux/tabicon-themes"
# Add the plugin
set -g @plugin 'mocaffy/tmux-tabicon'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'Then press prefix + I to install the plugin.
Clone the repository:
git clone https://github.com/mocaffy/tmux-tabicon.git ~/.tmux/plugins/tmux-tabiconAdd the following to your ~/.tmux.conf:
# Set the themes directory (create this directory if it doesn't exist)
set -g @tmux-tabicon-themes-dir "~/.config/tmux/tabicon-themes"
# Source the plugin
run-shell ~/.tmux/plugins/tmux-tabicon/tabicon.tmuxtmux-tabicon works by:
- Loading configuration files that define colors, icons, and formatting
- Generating tmux format strings based on these configurations
- Applying these format strings to window-status-format and window-status-current-format
- Refreshing the display when tmux events occur (new window, pane exit, etc.)
The plugin uses tmux hooks to automatically update the tab appearance when changes occur in your tmux session.
Create a themes directory and set it in your tmux.conf:
set -g @tmux-tabicon-themes-dir "~/.config/tmux/tabicon-themes"tmux-tabicon uses the following configuration files:
- default.conf - Built-in default settings (don't modify this)
- normal.conf - Your custom settings that apply to all sessions (create this in your themes directory)
- [session-name].conf - Session-specific settings (optional, create in your themes directory)
Create a normal.conf file in your themes directory:
mkdir -p ~/.config/tmux/tabicon-themes
touch ~/.config/tmux/tabicon-themes/normal.confHere are the key configuration options you can set in your theme files:
# Automatic colors (rotated through tabs)
auto_colors=("#9a348e" "#da627d" "#fca17d" "#86bbd8" "#06969A" "#33658a")
# Conditional colors (applied based on window name or other conditions)
manual_colors=("?#{==:#W,[tmux]},#0000ff")# Automatic icons (rotated through tabs)
auto_icons=("●")
# Conditional icons (applied based on window name or other conditions)
manual_icons=("?#{==:#W,[tmux]},")# Window title format
tab_title="#W"
# Formatting for tab beginning
tab_before_first=" " # For the first tab
tab_before="#[fg=#222233]▏" # For other tabs
# Style settings
style_tab="" # Base style
style_tab_icon="#[fg=#C]" # Icon style (#C is replaced with color)
style_tab_title="#[fg=#ffffff]" # Title style
# Formatting for tab end
tab_after=" " # For most tabs
tab_after_last=" " # For the last tab# Active window title format
tab_active_title="#W"
# Formatting for active tab beginning
tab_active_before_first=" "
tab_active_before="#[fg=#222233]▏"
# Style settings for active tab
style_tab_active="#[bg=#C]#[fg=#ffffff]" # Base style
style_tab_active_icon="" # Icon style
style_tab_active_title="" # Title style
# Formatting for active tab end
tab_active_after=" "
tab_active_after_last=" "# Character between tabs
tab_separator=""You can use tmux's conditional formatting to change colors or icons based on window properties:
# Make SSH windows red
manual_colors=("?#{==:#{pane_current_command},ssh},#ff0000")
# Add special icon for vim windows
manual_icons=("?#{==:#{pane_current_command},vim},")Create a configuration file named after your session:
# For a session named "dev"
touch ~/.config/tmux/tabicon-themes/dev.confThis configuration will only apply when you're in the "dev" session.
If your tabs aren't updating properly:
- Press
prefix+ r to manually refresh the tabs - Check that your themes directory is set correctly
- Verify your configuration files have the correct syntax
- tmux-tabicon-theme - Pre-made themes for tmux-tabicon

