Skip to content

Instantly share code, notes, and snippets.

@gocs
Last active February 16, 2024 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gocs/b69e689f03cf18fda219152e0e0ad422 to your computer and use it in GitHub Desktop.
Save gocs/b69e689f03cf18fda219152e0e0ad422 to your computer and use it in GitHub Desktop.
Start tmux at Windows Terminal WSL startup

image

Start tmux in Windows Terminal WSL startup

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

image image image

If the linux distro used is the default, use this Command line

C:\Windows\system32\wsl.exe /etc/init-wsl
@Dreded
Copy link

Dreded commented Feb 16, 2024

or just put tmux a at the end of whaetever command is there (tmux a will attach to last session)

my command: C:\WINDOWS\system32\wsl.exe -d Ubuntu tmux a

you can take this further and use a program like tmuxifier to make specific work flows so you can have profiles that auto go to that workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment