I have installed PyCharm Community Edition on Windows 10, my Windows also has WSL Ubuntu installed.
We know that PyCharm on Linux can create and run shell scripts because PyCharm use the /bin/bash on Linux.
But on Windows, PyCharm doesn't know where to find /bin/bash. So I change the settings on PyCharm on Windows 10.
In File-->Settings-->Tools-->Terminal, change the shell path from cmd.exe to bash.exe.
When this is done, I can run Linux command in the PyCharm terminal like this:
We can see that the file path has been changed to /mnt/c/Users/pcl/PycharmProjects/test-1
The problem is, when I run shell scripts from the PyCharm IDE, it gives this error:
It says, /bin/sh: 0: Can't open C:/Users/pcl/PycharmProjects/test-1/test-1.sh
Of course it can't open C:/Users/pcl/PycharmProjects/test-1/test-1.sh, because the file path has been changed to /mnt/c/Users/pcl/PycharmProjects/test-1 in WSL.
But PyCharm is just not smart enough to recognize it.
So what can I do?(I know run PyCharm in a Linux VM is a solution)