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

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.

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

13 comments

According to this post, the trick is to copy c:\Windows\System32\bash.exe to c:\bash.exe

Then you can change the shell path to simply c:\bash.exe. I can confirm that this works.

7

Hi there,

You can also try surrounding the path to the executable with double quotes, even if it does not have any spaces in it, e.g. (general example)

"C:\Users\USERNAME\AppData\Local\Programs\Git\bin\sh.exe " –login -i

https://youtrack.jetbrains.com/issue/IDEA-136139

-3

Try to use just bash or bash.exe.

-2

Expected behaviour is not about change terminal settings, but run "bash" inside default terminal like windows 10 does.

1

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.

3

Working with fish on Webstorm terminal on Windows 10 using 64bit jdk, awesome

"C:\windows\system32\bash.exe" -c fish -cur_console:p

1

This also works though I am on windows 8.1

"C:\Program Files\Git\bin\sh.exe" -login -i

0

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"

3

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.

1

for version phpstorm 2017 (windows 10) settings work!!!

change

Path to the project

change 

win username
0

Just put bash.exe on shell path

0

A simpler approach is to call the ubuntu executable directly. In this case, the path would look like:

 

C:\Users\<my_user>\AppData\Local\Microsoft\WindowsApps\ubuntu.exe

3

Please sign in to leave a comment.