tmux-sessionizer¶
A script that lets you fuzzy-find directories and jump to (or create) a tmux session rooted there. Activated on every new shell — if you're not already inside tmux it picks or creates a session automatically.
Usage¶
With no arguments, opens an fzf picker showing current directory, active tmux sessions, and all directories found under TS_SEARCH_PATHS.
| Option | Description |
|---|---|
[SEARCH_PATH] |
Skip fzf and go directly to a specific path |
-s, --session <index> |
Run a TS_SESSION_COMMANDS entry (see below) |
--vsplit |
Open session command in a vertical split (use with -s) |
--hsplit |
Open session command in a horizontal split (use with -s) |
-v, --version |
Print version |
-h, --help |
Print help |
Config file¶
Located at ~/.config/tmux-sessionizer/tmux-sessionizer.conf (symlinked from config/tmux-sessionizer.conf).
TS_SEARCH_PATHS¶
Array of directories to search for projects. Overrides the built-in default.
Append :depth to a path to control how deep the search goes for that entry:
Default max depth is 1 unless overridden by TS_MAX_DEPTH.
TS_EXTRA_SEARCH_PATHS¶
Add paths on top of TS_SEARCH_PATHS without replacing them.
TS_MAX_DEPTH¶
Default search depth for entries that don't specify their own. Default: 1.
TS_SESSION_COMMANDS¶
List of shell commands accessible via -s <index>. Useful for opening tools in dedicated windows or panes without breaking your current workflow. Commands are placed in high-numbered windows (index 69+) so they don't interfere with regular windows.
Usage:
tmux-sessionizer -s 0 # open lazygit in a new window
tmux-sessionizer -s 0 --vsplit # open lazygit in a vertical split pane
tmux-sessionizer -s 1 --hsplit # open btop in a horizontal split pane
Split panes are cached — re-running the same command will focus the existing pane rather than opening a new one.
TS_LOG / TS_LOG_FILE¶
Enable debug logging.
TS_LOG=file # write logs to TS_LOG_FILE
TS_LOG=echo # print logs to stdout
TS_LOG_FILE=~/my-ts.log # custom log path (default: ~/.local/share/tmux-sessionizer/tmux-sessionizer.logs)
Session hydration¶
When a new session is created, the script looks for a .tmux-sessionizer file to source:
<project-dir>/.tmux-sessionizer— project-local setup (runs windows, starts servers, etc.)~/.tmux-sessionizer— global fallback
Hydration is skipped when using -s/--session.