Skip to content

tmux

tmux on Windows: WSL2, Git Bash, and what actually works

There is no native Windows build of tmux. WSL2 is the practical option; Git Bash and Cygwin exist but neither runs tmux well. Here is the real setup.

Nadia Okonkwo6 min read

There is no native Win32 build of tmux — it depends on a Unix pty layer Windows doesn't have. The practical option is WSL2, which runs a real Linux kernel and a real tmux. Git Bash/MSYS2 and Cygwin can technically launch a tmux binary, but pty emulation on both is incomplete enough that panes, resizing, and mouse support break in ways that make daily use painful. Use WSL2.

Why tmux doesn't just run on Windows

tmux is built directly on Unix ptys (pseudo-terminals) and Unix process semantics — forking, signal handling, SIGWINCH for resize events. None of that exists natively on Win32. Every "tmux on Windows" option is really a Unix compatibility layer running tmux inside it, with whichever gaps that layer has.

OptionWhat it actually isVerdict
WSL2Real Linux kernel in a lightweight VMUse this
Git Bash / MSYS2MinGW pty emulation over Win32 consoleWorks for basic sessions; panes and resize are flaky
CygwinPOSIX layer translating to Win32 callsMore complete than Git Bash, still not a real pty
Windows Terminal aloneA terminal emulator, not a tmux implementationNeeds WSL2 or another backend underneath

Setting up tmux in WSL2

Install WSL2

From PowerShell (as administrator): wsl --install. This installs WSL2 and a default Ubuntu distribution. If you already have WSL1 distros, wsl --set-version <distro> 2 upgrades them.

Install tmux inside the distro

Open the Ubuntu shell from the Start menu and run sudo apt update && sudo apt install tmux. See installing tmux if your distro's version is too old for something you need.

Use Windows Terminal as the front end

Windows Terminal (built into Windows 11, installable on Windows 10) auto-detects WSL distributions and gives you a proper profile with correct fonts and true color. Don't run tmux inside the legacy conhost.exe window — Windows Terminal's rendering is meaningfully better and doesn't clip colors.

Verify truecolor works

Run tmux new, then inside it echo $COLORTERM — it should print truecolor if Windows Terminal and your tmux config are both set up right. If it's empty, add set -sa terminal-overrides ",*:RGB" to ~/.tmux.conf.

WSL1 still exists — don't use it for this

wsl --install defaults to WSL2 on any reasonably current Windows install, but if you're on an older machine that ended up with WSL1, tmux runs noticeably worse on it. WSL1 translates Linux syscalls to Windows kernel calls rather than running a real Linux kernel, and tmux's pty and signal handling hit enough of the gaps in that translation layer that resizing and job control are unreliable. wsl --set-version <distro> 2 upgrades an existing distro in place.

Clipboard interop: the actual friction point

Copying from tmux's copy mode doesn't reach the Windows clipboard by default — WSL2's Linux environment and Windows are still two separate clipboards until you wire them together. Two tools do it:

ToolDirectionNotes
clip.exeLinux → Windows onlyShips with Windows, already on PATH inside WSL
win32yankBoth directionsSeparate binary, needs installing and adding to PATH

clip.exe is the zero-install option if you only need copy-out:

~/.tmux.conf
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "clip.exe"

For paste-in too, install win32yank and bind both directions:

~/.tmux.conf
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "win32yank.exe -i"
bind ] run "win32yank.exe -o | tmux load-buffer - ; tmux paste-buffer"
WSL2 — verifying clip.exe reaches Windows
[object Object],[object Object],[object Object]

The gotcha: sessions dying when the last window closes

This is the one that catches people who set up tmux in WSL2, walk away from a running session, and come back to find it gone. WSL2 runs each distro as a lightweight VM that Windows tears down automatically after a short idle period once every WSL window is closed — by default 60 seconds after the last WSL process disconnects, controlled by vmIdleTimeout in %UserProfile%\.wslconfig. A detached tmux session is still a running process, which normally keeps the VM alive, but if you've also enabled systemd=true in /etc/wsl.conf for real service management, some setups report the VM idling out anyway and taking the tmux server with it.

If your tmux sessions keep vanishing after enabling systemd

Check %UserProfile%\.wslconfig for a [wsl2] section and set vmIdleTimeout=-1 to disable the automatic shutdown entirely, or raise it well past however long you're away from the machine. The setting only takes effect after a full WSL restart (wsl --shutdown from PowerShell, then reopen).

%UserProfile%.wslconfig
[wsl2]
vmIdleTimeout=-1

This is worth knowing before you enable systemd in the first place, not after a session vanishes. Most people turn it on chasing systemctl for a database or Docker daemon they want managed properly — if that's the goal, pair it with vmIdleTimeout=-1 from the start rather than debugging a disappearing tmux session later.

Git Bash and Cygwin, honestly

If WSL2 genuinely isn't an option — a locked-down corporate machine, no admin rights to enable it — Git Bash can run tmux, but expect rough edges: pane splits sometimes misrender on resize, and SIGWINCH handling through MSYS2's pty layer is unreliable enough that a maximized window doesn't always tell tmux its new size. Cygwin's mintty is a better terminal for it than Git Bash's default console and gets you closer to correct behavior, but neither is what you'd choose if WSL2 were available. Treat both as a fallback, not a destination.

Checking a WSL2 session from outside Windows

If you're running long jobs inside a WSL2 tmux session and want to check on them from your phone, the normal answer is SSH into the box and tmux attach — see tmux attach session. Once tmux itself is running, the rest of your workflow — tmux commands, windows, panes, copy mode — is identical to any other Linux box. If you'd rather get a push notification when a pane finishes or blocks instead of manually reattaching, that's what mtmux does — it runs inside WSL2 like anything else and serves the session to a browser.

Can I install tmux directly on Windows without WSL?

Not a real one. tmux depends on Unix pty and process semantics that Win32 doesn't provide. Git Bash and Cygwin can run a tmux binary through compatibility layers, but panes and resizing are unreliable compared to WSL2.

Does Windows Terminal support tmux?

Windows Terminal is a terminal emulator, not a tmux backend — it renders whatever shell you point it at, including a WSL2 distro running tmux. It has good truecolor and font support, which makes it the recommended front end once tmux itself is running in WSL2.

Why does my tmux session in WSL2 disappear after closing all windows?

WSL2 shuts down its lightweight VM a short time after every window connected to it closes, controlled by vmIdleTimeout in .wslconfig (60 seconds by default). Set vmIdleTimeout=-1 to stop it from happening.

How do I copy from tmux to the Windows clipboard?

Bind your copy-mode-vi copy action to pipe into clip.exe, which ships with Windows and is already on WSL2's PATH. For paste support too, install win32yank and bind both directions.

Put this to work — mtmux attaches to the tmux server you already run.

Related reading