0

I want to run Windows native PhpStorm from within WSL2 and ask it to open the current directory.

JetBrains Toolbox includes scripts to launch their applications from the command line (i.e. phpstorm.cmd). WSL2 supports running windows executables from WSL2, however, this does not seem to work with these scripts.

Therefore, I decided to try:

$ powershell.exe phpstorm.cmd

And this works fine and opens PhpStorm. I then need to tell PhpStorm to open the current working directory.

In Linux, this would be phpstorm . or in windows phpstorm.cmd .

I tried both of these:

$ powershell.exe phpstorm.cmd .
$ powershell.exe phpstorm.cmd pwd
$ powershell.exe -c "phpstorm.cmd $((pwd).Path)"

But neither passed the pwd as the context.

It seems to be an issue with UNC paths not being supported in CMD.EXE:

glen@Sisko:~/repos/gclark18/tdd-dailyjobs$ powershell.exe -c "phpstorm.cmd $((pwd).Path)"
-bash: command substitution: line 1: syntax error near unexpected token `.Path'
-bash: command substitution: line 1: `(pwd).Path'
'\\wsl$\Ubuntu\home\glen\repos\gclark18\tdd-dailyjobs'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.

Can anyone advise how to do this please?

gclark18
  • 659
  • 6
  • 23

0 Answers0