How can you use new Bash on Ubuntu on Windows terminal in Webstorm?
Follow

I am using Bash on Ubuntu on Windows, and I changed the Shell path in Settings > Tools > Terminal from C:\Windows\System32\cmd.exe to C:\Windows\System32\bash.exe ~. However, I now get the following error when trying to open a new Terminal tab: java.io.IOException: Couldn't create PTY.

Make sure you are using the 64 bit version of the IDE. I had this problem with Idea, and it took me a while to figure out that my shortcut was actually launching the 32bit version of the IDE. Once I did this, I could just change cmd.exe to bash.exe and it works.

Setting the terminal to C:\windows\system32\bash.exe works with the major caveat that it doesn't on 32 bits. If you are running a 32 bit IntelliJ, you get that error: Terminal tab: java.io.IOException: Couldn't create PTY. In a modern computer, all 64 bit, by default, the shortcut IntelliJ creates in your start menu is for 32 bit, edit it to point to "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.3.2\bin\idea64.exe" instead of "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.3.2\bin\idea.exe"

Pupeno's answer is the correct one. You shouldn't have to copy bash.exe out of its default directory. What should be done is Jetbrains should update their installer to install the 64-bit shortcut on 64-bit Windows by default so that this is no longer an issue, especially with the Windows 10 Creators Update fixing the issues in WSL that didn't make it viable as a CLI for devs.

Also make sure "Start Directory" is a directory that resolves in a windows command prompt, vs. one that is specific to WSL. If it is the latter that will prevent the WSL shell from being started in the first place.