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?
In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Languages & Frameworks | Node. js. , and then select Add WSL from the list. In the Add WSL Node Interpreter dialog that opens, select the Linux distribution you're using and specify the path to Node.
From the WSL terminalOpen a WSL terminal window (using the start menu item or by typing wsl from a command prompt / PowerShell). Type code . in the terminal. When doing this for the first time, you should see VS Code fetching components needed to run in WSL.
In IntelliJ IDEA, you can directly open a project stored in the WSL file system and work with it like with any other project. Click Open on the Welcome screen or select File | Open from the main menu.
wsl.exe and bash.exe live in \Windows\System32 . 64 bit applications have that path mapped into their path on where to look for files. However, 32 bit applications do not look in System32 for files - they look in the SysWow64 folder.
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
Set:
Settings > Tools > Terminal > Shell path
Equal to:
"C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\ubuntu.exe" run
The result is:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With