In this easy-to-follow guide, I will show you how to add WSL to your windows terminal.
Fire up your Windows Terminal.
2. Navigate to Settings:
Click the dropdown icon located beside the tabs to reveal the menu list. Select "Settings" from the list.
3. Add a New Profile:
Scroll down to the bottom of the settings page and spot the plus icon. Click on it to add a new profile. Instead of creating a new profile from scratch, we'll duplicate an existing profile. I prefer to start with CMD as it's the most basic. Select CMD from the dropdown menu and hit the duplicate button. A new profile named "Command Prompt (Copy)" will appear in the profile list on the left pane.
4. Edit your New Profile:
Fill the fields of your duplicated profile as follows:
Name:
Label your new profile. I'll go with "WSL," but you can choose whatever suits you best. Your new profile name will replace the old "Command Prompt (Copy)". See yellow box in above screenshot.
Command Line:
Replace "cmd" with "wsl" to launch the terminal with WSL. Your command line should look like this: %SystemRoot%\System32\wsl.exe.
Starting Directory:
Put the tilde '~' symbol here so that the terminal always opens in the user's home directory.
Icon:
Windows Terminal already has icons for Linux. Navigate to C:\Program Files\WindowsApps and find one or more folders starting with "Microsoft.WindowsTerminal_." Look for the one containing a "profileIcons" folder. Copy the name of the Linux icon and paste it into the icon field. Voila! Your icon changes instantly. See yellow box in above screenshot.
Tab Title:
Give your terminal tab a label.
5. Save Your Changes:
Once you've made the necessary edits, click on "Save."
7. Select Your New Profile:
Now, click on the dropdown menu in the navigation bar. You'll see your newly created profile. Click on it to open an Ubuntu (or your preferred Linux distro) terminal ready for action!
And that's it! You've successfully added WSL to windows terminal. Easy, isn't it?
Happy hacking!
Follow Me