I just created a shortcut which points to the following location:
C:\msys64\usr\bin\mintty.exe --icon C:\Windows\System32\wsl.exe --dir \\wsl.localhost\ubuntu_20.04\home\<user> --wsl -t WSL -s 240,60 -e wsl
where:
C:\msys64\
is msys2 root directory;
ubuntu_20.04
is my WSL distribution. You can get it by wsl -l -v
;
- with
--dir ...
I can enter my WSL home directory by default, otherwise I will enter msys2/mintty home directory default.
-e wsl
tells mintty to run wsl.exe
command;
- For other command line options, see https://mintty.github.io/mintty.1.html.
This works for me.
You may try https://github.com/mintty/wsltty as well. Seems it has integrated with wslbridge2, but I didn't notice the difference.
One thing I am still trying to figure out is that -- in the mintty window, if I click a path (say /home/<user>/Downloads
) with Ctrl key hold, then mintty tries to open %UserProfile%\AppData\Local\lxss\home\<user>\Downloads
in Windows explorer, then it will fail. If it can open \\wsl.localhost\ubuntu_20.04\home\<user>\Downloads
then it will be perfect.
But I tried wsltty and found this problem is not resolved. So for me, wsltty is not necessary.