Window ManagementN/A
respawn-window
Short form: respawnw
Reuse a window to run a command, restarting it in place. Useful for windows whose command exited when remain-on-exit is on.
Synopsis
bash
tmux respawn-window [-k] [-c start-directory] [-e environment] [-t target-window] [shell-command [argument ...]]Options
| Flag | Description |
|---|---|
| -k | Kill the existing command first if it is still running |
| -c start-directory | Set the working directory |
| -t target-window | Window to respawn |
Examples
Restart the window's command
bash
tmux respawn-window -k 'npm run dev'Respawn window 2 with its default command
bash
tmux respawnw -t 2Default Keybinding
N/A
Default prefix is Ctrl+b
Pro Tips
- •Pair with set -g remain-on-exit on to inspect output before respawning
- •Use -k to force-restart a still-running command