This uses the handy wslpath tool from the WSL Utilities collection by Patrick Wu. form, escape the backslashes and then pop the result on the clipboard ready for you to paste into your terminal settings. This will convert the WSL HOME folder path to \\wsl$\. Only when starting Ubuntu 20.04 from the Windows Terminal profile I get the wrong starting folder. A quick tip: Select the GUID with the mouse and right-click to copy. We are going to need that GUID in the coming steps. In the Ubuntu window, execute the uuidgen command. To make it easy to get this path you can run the following command from your distro. When I start Ubuntu-20.04, my home folder is /mnt/c/Users/glenn (my Windows home folder). To generate a new GUID, search for Ubuntu in the start menu and open it. If you are using the Windows Terminal Settings UI, rather than the settings.json file, to declare this path, you can use the Browse. Backslashes need to be escaped, so this becomes \\\\wsl$\\. The path needs to be a Windows path - so for your HOME folder in WSL you need to use the \\wsl$\.There are two things to bear in mind for this property: For each profile you can set a startingDirectory property. Fire up Windows Terminal and press Ctrl , to open the JSON settings. When you embrace this mindset, having Windows Terminal put you in a mounted Windows path is less helpful - I like to have it default to my HOME directory for the distro.įear not! This can be configured in the Windows Terminal settings. mnt/c/Users/stuart).Īs this post by Simon Ferquel suggests: “Fully embrace WSL2”! In other words, use the file system in your WSL distro. As a WSL user, a really nice feature is that it auto-detects the WSL distros you have installed.īy default, when you launch Windows Terminal for a WSL distro it puts you in the /mnt/. In the screen shot below, Firefox and Terminal server client applications were started. The terminal window can be opened instantly by entering this shortcut, and it can be used. This keyboard shortcut is perhaps the simplest to use. Windows Terminal is the new Terminal experience from the Windows team. To open the terminal window on Ubuntu 22.04 desktop, press CTRL / ALT / T. Cross-posted from wsl.tips/tips/windows-terminal-start-directory
0 Comments
Leave a Reply. |