Tmux should already be installed in your system
apt install tmux
Create a file in /etc/init-wsl
#!/usr/bin/env bash
exec tmux
The file should then be user executable
sudo chmod u+x /etc/init-wsl
Go to Terminal Settings > Debian (Profiles) > Command line
If the linux distro used is the default, use this Command line
C:\Windows\system32\wsl.exe /etc/init-wsl
tmux a
only works when there is already a Tmux session running. My setup isC:\WINDOWS\system32\wsl.exe -d Ubuntu tmux new-session /bin/zsh
. It will create a new session each time when you open a new window, and you can explore and attach to a Tmux sessions with<prefix> + s