How to use WSL as default terminal in WebStorm or any other JetBrains' products?

forkadam picture forkadam · Aug 18, 2018 · Viewed 23.2k times · Source

I am currently using Windows 10 with WSL Ubuntu 18.04 installed. I am trying to use WSL as the default terminal in WebStorm however, I am able to use the bash from WSL but the default directory would not be set to the default project location.

Does anyone know how to set this up correctly?

Answer

forkadam picture forkadam · Aug 18, 2018

After a bit of search on google found a solution to my question.

First figure out the default wsl with the command:

C:\Windows\System32\wslconfig /list

Windows Subsystem for Linux Distributions:
Ubuntu-18.04 
Legacy (Default)

then I set the default to Ubuntu-18.04 by

C:\Windows\System32\wslconfig /setdefault Ubuntu-18.04

Finally set the terminal path in Webstrom settings>tools>terminal to

C:\Windows\System32\wsl.exe

Now open the terminal it is correctly move the current directory to the /mnt/c/blah/blah