A lightweight CLI for handling TMUX sessions with ease!
Tmux Sessionizer is a highly configurable Tmux Session Manager based on ThePrimeagen's tmux-sessionizer script. It provides an intuitive interface for creating, managing, and switching between tmux sessions with pre-defined layouts and intelligent directory scanning.
- Interactive Session Selection: Use
fzf
for fuzzy finding and selecting sessions - Intelligent Directory Scanning: Automatically discover projects in configured directories
- Custom Session Layouts: Define window configurations with specific commands for each session
- Session Management: Create, switch, and kill sessions with simple commands
- Interactive TUI: Create sessions with a beautiful terminal user interface
- Configurable: YAML-based configuration with sensible defaults
- Tmux Integration: Seamlessly integrates with existing tmux workflows
tms
- Interactive session selector with fzftms create
- Interactive TUI for creating new sessionstms switch
- Switch between active tmux sessionstms kill
- Kill current session and switch to anothertms config init
- Create initial configuration filetms config edit
- Edit configuration file
tmux
- Terminal multiplexerfzf
- Fuzzy finder for interactive selection
git clone https://github.com/Pairadux/Tmux-Sessionizer.git
cd Tmux-Sessionizer
go install
The binary will be installed as Tmux-Sessionizer
in your $GOPATH/bin
directory.
For convenience, it's recommended to create an alias for the binary:
# Add to your shell configuration (.bashrc, .zshrc, etc.)
alias tms='Tmux-Sessionizer'
All examples in this README use tms
for brevity, but you can substitute Tmux-Sessionizer
if you prefer not to use the alias.
Configuration is stored in $XDG_CONFIG_HOME/tms/config.yaml
(typically ~/.config/tms/config.yaml
).
tms config init
# Directories to scan for projects
scan_dirs:
- path: ~/Dev
depth: 1 # Optional: scanning depth (default: 1)
alias: "" # Optional: display alias
- path: ~/.dotfiles/dot_config
# Additional entry directories (always included)
entry_dirs:
- ~/Documents
- ~/Cloud
# Directory names to ignore when scanning
ignore_dirs:
- ~/Dev/_practice
- ~/Dev/_archive
# Default layout for new tmux sessions
session_layout:
windows:
- name: edit
cmd: nvim # Command to run in window
- name: term
cmd: "" # Empty command opens shell
# Fallback session for when killing the final session
fallback_session:
name: Default
path: ~/
layout:
windows:
- name: window
cmd: ""
# Tmux configuration
tmux_base: 1 # Base index for tmux windows (0 or 1)
default_depth: 1 # Default scanning depth
tmux_session_prefix: "[TMUX] " # Prefix for active sessions
# Editor for config editing
editor: vi
Scan directories are searched recursively for projects. Each directory can have:
path
: Directory path to scan (supports~
expansion)depth
: How deep to scan (optional, usesdefault_depth
if not specified)alias
: Display name in selector (optional)
Define default window configurations:
name
: Window namecmd
: Command to run when window opens (optional)
Sessions can have custom layouts defined in the fallback session or applied globally.
# Launch interactive session selector
tms
# Create a new session interactively
tms create
# Switch between active sessions
tms switch
# Kill current session and switch to another
tms kill
# Create initial config
tms config init
# Edit config file
tms config edit
# Create/switch to session by name
tms my-project
This program is in a highly unstable state. The API and commands are subject to change before final release. The overall functionality of the program should be stable, unless otherwise stated though.