Automatically runs pnpm/npm/yarn/bun scripts (e.g., pnpm dev, npm start) in a dedicated tmux session.
Each script gets its own tmux window with a horizontal split:
- Left pane: Runs the dev server/script.
- Right pane: An interactive shell in the same project directory for additional commands.
Whenever you run lets say pnpm run dev it will take that command and run that in the same dir but in a new tmux session freeing your current terminal.
tmuxmust be installed on your system.- Zsh shell.
- Clone this repository into your Oh My Zsh custom plugins directory:
git clone https://github.com/ronitize/ZSH-TMUXDEV.git ${ZSH_CUSTOM:- $HOME/.oh-my-zsh/custom}/plugins/ZSH-TMUXDEV - Add
ZSH-TMUXDEVto yourpluginsarray in your~/.zshrcfile:plugins=(git ZSH-TMUXDEV) # Add it to your existing plugins - Source your
~/.zshrcfile or open a new terminal session:source ~/.zshrc
- Add the following line to your
~/.zshrcfile:antigen bundle ronitize/ZSH-TMUXDEV
- Source your
~/.zshrcfile or open a new terminal session.
- Add the following line to your
~/.zshrcfile:zinit light ronitize/ZSH-TMUXDEV
- Source your
~/.zshrcfile or open a new terminal session.
- Clone this repository to a convenient location (e.g.,
~/.local/share/zsh-plugins/ZSH-TMUXDEV):git clone https://github.com/ronitize/ZSH-TMUXDEV.git ~/.local/share/zsh-plugins/ZSH-TMUXDEV - Add the following line to your
~/.zshrcfile:source ~/.local/share/zsh-plugins/ZSH-TMUXDEV/tmux-dev-wrapper.plugin.zsh
- Source your
~/.zshrcfile or open a new terminal session.
After installation, simply use pnpm, npm, yarn, or bun commands as you normally would for running scripts. This includes both explicit run commands and common direct script executions.
pnpm run devnpm startyarn buildbun dev --watchpnpm test
These commands will now automatically open new tmux windows within the TMUXDEV session, each split horizontally with your script running in the top pane and an interactive shell in the bottom.
To attach to your tmux development session:
tmux attach -t TMUXDEVInside the TMUXDEV session:
- Switch windows:
Ctrl+bthenn(next),p(previous), orw(show window list). - Switch panes:
Ctrl+bthenup/down arrow keys. - Kill a server: Navigate to its pane and press
Ctrl+c. The interactive shell in the bottom pane will remain active. - Close a pane/window: Type
exitor pressCtrl+din the pane.