Problem recurrence
The Windows Terminal application (terminal) should be the best command-line UI tool on Win at present, and it is very refreshing to use WSL through the terminal. But every time you start the terminal, either the user directory (/mnt/c/User/<username>) is opened by default, or the Linux home directory (/home/<username\). If you want to open a specific path, you need to cd to it yourself.
problem solved
There are already tutorials to teach you how to create a new right-click menu from the registry and open the terminal WSL. Here is how to set up the terminal to correctly open WSL in the current right-click directory.
The WSL version on my computer is Ubuntu. If you have other versions, please replace Ubuntu in the instructions below.
- First, the terminal's
设置
--page启动
should look like this:
- Then,
设置
the --page of the terminalUbuntu
should be like this, focusing on modifying the command line settings (the default is directlyubuntu.exe
, to be modifiedC:\Windows\system32\wsl.exe -d Ubuntu
)
- Finally, don't forget to click Save to take effect.