Enable bash terminal in PHPStorm on Windows 10

If you are using Linux or Mac OS, then using the PHPStorm(or any other IntelliJ IDE from Jetbrains) terminal is not a problem at all. You already have access to all bash commands. But if you ever wanted to use bash commands in Windows 10, which are specific for Linux, you probably got stuck. There is no solution that works since by default it uses cmd.exe program.

Let’s fix this.

Note: I recommend to use WSL: Replace PHPStorm terminal with WSL.

First of all, you must install Git for Windows.
You can download the installer form this website: https://git-scm.com/

After this, you’ll get in your system some handy tools you can learn about. But for now, we are interested only in the bash terminal that is included in this installer. You can find it in the directory which contains all GitSCM files.

OK. Now we are ready to integrate the git terminal in PHPStorm.

Open PHPStorm settings, go to Tools->Terminal and update the “Shell Path” with the following value:

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

Now start a new terminal session and you must be able to run commands that are available in Linux.

Enjoy!

Andrew
Member since January 2, 2019

Comments

    Avatar

    Your email address will not be published. Required fields are marked *