On PhpStorm 2016.2 EAP, the popup dialog to select a Shell path doesn't see or allow me to select C:\Windows\System32\bash.exe despite the file being there (and I'm able to run it from command line given the full path). If I do put in the path manually without going through the dialog, when I try to open a terminal it gives me a Java Exception, saying that it was unable to start PTY. This holds true even if I start PhpStorm as Administrator
The workaround works, though I'm not sure if it'll have any unexpected side effects. Will use for a while and report back. To confirm, enabling "Show hidden files and folders" does not fix this issue. PhpStorm is still unable to see or use C:\Windows\System32\bash.exe
FYI: This is related but not sure if this is the best place for this.
In order to get bash to work in the terminal is to copy the base.exe file out of the system32 directory. I don't know why but IntelliJ will not show some files. See below image. And it doesn't matter if show hidden files is selected or not.
The bash.exe might be found inside `C:\Windows\Sysnative\bash.exe`. Windows uses this naming when starting 32-bit processes from 64-bit world or something like that... You can Google it.
Unfortunately, I can't work in storm (either Php or Web) under windows, while having a task runner like gulp watching files for changes. If I run gulp watch on, let’s say “src/ts/**/*”, from "Bash on Ubuntu on Windows", then I can’t edit any file in that folder using Php/WebStorm on Windows. If I try to modify/save a file, I get an error and it doesn’t save it. “Cannot save. The file is left unchanged.” And it writes the modified file content in a temp file in the same place as the original file. I have no idea why does Storm do that (if I edit the file with any simple text editor, it works just fine).
I don't always get the error on the first save attempt, sometimes there's a delay... sometimes it starts with the second "save" attempt. But, the bottom line, Storm somehow isn't compatible with Bash on Ubuntu on Windows :(
Luckily, as long as the project doesn't involve php, I can just use VSCode.
Looks as if PhpStorm is not permitted to delete files on WSL. Does the problem only occur when using Bash shell / WSL to run Gulp, or can be recreated when using cmd /powershell? Please try disabling 'Use "Safe write"' in File | Settings | Appearance & Behavior | System Settings - does it make things any better?
Thank you Bradozman would've never guessed it was as simple as putting 'WSL' into the Settings -> Tools -> Terminal -> Shell Path field. This needs to be the first result when searching for compatibility issues using Windows Subsystem for Linux WSL and PHPStorm
Can't you set a path to bash.exe as Shell path in Settings | Terminal?
Hi Elena,
I've not tried actually - I was just generally checking to see what the situation was.
I'll have a try next time I boot into Windows :)
Cheers,
Dave
On PhpStorm 2016.2 EAP, the popup dialog to select a Shell path doesn't see or allow me to select C:\Windows\System32\bash.exe despite the file being there (and I'm able to run it from command line given the full path). If I do put in the path manually without going through the dialog, when I try to open a terminal it gives me a Java Exception, saying that it was unable to start PTY. This holds true even if I start PhpStorm as Administrator
Please see https://intellij-support.jetbrains.com/hc/en-us/community/posts/207322745-Windows-10-bash-Insider-Preview-doesn-t-work-on-PHPStorm-terminal- for possible workaround
>the popup dialog to select a Shell path doesn't see or allow me to select C:\Windows\System32\bash.exe
Do you mean that the file is not visible in the file chooser? Did you try enabling 'Show hidden files and folders'?
The workaround works, though I'm not sure if it'll have any unexpected side effects. Will use for a while and report back. To confirm, enabling "Show hidden files and folders" does not fix this issue. PhpStorm is still unable to see or use C:\Windows\System32\bash.exe
Confirmed on Windows 10 Home Edition major build 1607 in WebStorm 2016.2 as well.
FYI: This is related but not sure if this is the best place for this.
In order to get bash to work in the terminal is to copy the base.exe file out of the system32 directory. I don't know why but IntelliJ will not show some files. See below image. And it doesn't matter if show hidden files is selected or not.
The bash.exe might be found inside `C:\Windows\Sysnative\bash.exe`. Windows uses this naming when starting 32-bit processes from 64-bit world or something like that... You can Google it.
And BTW I created a bridge https://github.com/michal-kocarek/PhpOnWindows for running PHP in Bash on Windows directly from PhpStorm, please feel free to try it :-)
Unfortunately, I can't work in storm (either Php or Web) under windows, while having a task runner like gulp watching files for changes. If I run gulp watch on, let’s say “src/ts/**/*”, from "Bash on Ubuntu on Windows", then I can’t edit any file in that folder using Php/WebStorm on Windows. If I try to modify/save a file, I get an error and it doesn’t save it. “Cannot save. The file is left unchanged.” And it writes the modified file content in a temp file in the same place as the original file. I have no idea why does Storm do that (if I edit the file with any simple text editor, it works just fine).
I don't always get the error on the first save attempt, sometimes there's a delay... sometimes it starts with the second "save" attempt. But, the bottom line, Storm somehow isn't compatible with Bash on Ubuntu on Windows :(
Luckily, as long as the project doesn't involve php, I can just use VSCode.
Looks as if PhpStorm is not permitted to delete files on WSL.
Does the problem only occur when using Bash shell / WSL to run Gulp, or can be recreated when using cmd /powershell? Please try disabling 'Use "Safe write"' in File | Settings | Appearance & Behavior | System Settings - does it make things any better?
@Elena Pogorelova
Yes, it only occurs when running gulp under Bash shell. Cmd/Powershell is fine.
Thank you for the tip. Disabling `Use "Safe write"` does the trick. With Safe write turned off, I don't get the error anymore.
Great, thanks for update:)
Just put `bash` or better yet `wsl` as your terminal command no need to locate the files.
Thank you Bradozman would've never guessed it was as simple as putting 'WSL' into the Settings -> Tools -> Terminal -> Shell Path field. This needs to be the first result when searching for compatibility issues using Windows Subsystem for Linux WSL and PHPStorm