Run tmux on Windows
tmux is a Unix-native tool and does not run on Windows natively. The recommended way to experience tmux on Windows is through WSL2 (Windows Subsystem for Linux 2), which provides a real Linux kernel. Alternatives include MSYS2 and Cygwin, though they provide a less complete experience.
Method 1: WSL2 (Recommended)
WSL2 provides a complete Linux environment inside Windows with full system call compatibility, making tmux work exactly as it does natively on Linux.
Enable WSL2
Open PowerShell as Administrator and run:
PS> wsl --install
# Installs WSL2 + Ubuntu by default. Restart when prompted.
For a specific distro: wsl --install -d Ubuntu-22.04
Restart your PC
WSL2 requires a restart to complete installation. After restarting, Ubuntu will launch automatically on first boot and ask you to set up a username and password.
Install tmux inside Ubuntu (WSL2)
$ sudo apt update && sudo apt install tmux
$ tmux -V
tmux 3.x
Windows Terminal Integration
Windows Terminal is the best way to use WSL2 and tmux on Windows. Configure it for an optimal experience.
🚀 Auto-Launch tmux
Set tmux to launch automatically with your WSL2 profile. In Windows Terminal → Settings → your Ubuntu profile → Command line:
wsl.exe ~ -e tmux
⌨️ Key Binding Conflicts
Windows Terminal may intercept some tmux key bindings (like Ctrl+Shift+P). In Windows Terminal settings, disable conflicting key bindings under Actions, or use null to unmap them.
The most common conflict is Ctrl+b — Windows Terminal usually passes it through correctly, but verify under Settings → Actions.
📋 Copy/Paste with Windows Clipboard
In WSL2, tmux can access the Windows clipboard via clip.exe. Add to ~/.tmux.conf:
$ set -s copy-command 'clip.exe'
# Or using tmux-yank plugin (preferred):
$ set -g @plugin 'tmux-plugins/tmux-yank'
Method 2: MSYS2
MSYS2 provides a lightweight Unix-like environment on Windows without requiring a full Linux kernel. Suitable for simpler setups.
# Install MSYS2 from https://www.msys2.org first, then:
$ pacman -Syu
$ pacman -S tmux
$ tmux -V
Limitation: MSYS2 lacks a real Linux kernel — some tmux features (like socket-based session sharing) may behave differently than on native Linux or WSL2.
Method 3: Cygwin
Cygwin provides a POSIX-compatible layer for Windows. Recommended only for legacy environments.
Installing tmux via Cygwin Setup
- Download the Cygwin installer from cygwin.com
- Run the installer and select a mirror
- In the package selection screen, search for
tmux - Select the
tmuxpackage from the Net or Utils category - Complete installation and open the Cygwin terminal
- Verify:
tmux -V
⚠️ Limitation: Cygwin doesn't provide a real Linux kernel. tmux works, but session sharing, socket handling, and some system calls may behave differently. WSL2 is strongly preferred for a complete tmux experience.
Troubleshooting on Windows
Common WSL2 issues
wsl --status in PowerShell. Update WSL2 with wsl --update. If you get "WSL 2 requires an update to its kernel component", run wsl --update in an elevated PowerShell prompt.
tmux: no server running on /tmp/tmux-XXXX/default
tmux new. If the socket directory doesn't exist, it may have been cleaned up. Ensure /tmp is writable in your WSL2 environment: ls -la /tmp. If WSL2 was restarted, existing tmux sessions will have been lost.
Colors or fonts not rendering correctly
set -g default-terminal "tmux-256color" to your ~/.tmux.conf. In Windows Terminal, ensure your color scheme supports 256 colors. Install a Nerd Font (e.g., JetBrains Mono Nerd Font) from nerdfonts.com and set it as your Windows Terminal font for proper powerline/icon support.
tmux sessions lost when WSL2 restarts
tmux-resurrect and tmux-continuum plugins. Also, you can prevent WSL2 from shutting down by keeping a background WSL2 process running, or by configuring %USERPROFILE%\.wslconfig with [wsl2] autoMemoryReclaim=disabled.