I'm looking to launch PhpStorm via the command line using zsh + oh-my-zsh.
pstorm .
I have read up on the topic and have seen countless suggestions pointing to "Create command-line launcher" and have messed with it extensively. I have also messed with the Application Settings > Shell Path
by setting it to /bin/zsh
, usr/bin/zsh
, etc.
I always end up with:
zsh: command not found: pstorm
One thing I have noticed is when setting the Shell Path to /bin/zsh
specifically, the text is greyed out in the field, as if to indicate it's invalid?
I have been regularly restarting iTerm to enable any new changes that may have been made to .zshrc.
Anyone out there done this successfully? Any ideas?
The Tools
menu of PhpStorm contains a command named Create command-line launcher
. It asks you where to create the launcher (full path + file name) and on Unix-like systems it defaults to /usr/local/bin/pstorm
.
Also, on Unix-like systems, /usr/local/bin
usually is on the path. You can run echo $PATH
in the terminal to find out if this is the case or not. If it's not there you can easily add it by adding the line:
PATH=/usr/local/bin:$PATH
in your .zshrc
.
You can also use a different path for the command line launcher (in the bin
subdirectory of your home directory, for example, or in other directory that already is in $PATH
).
Shell path
under the Tools -> Terminal
page of the program settings is a different thing (and it doesn't help you launch PhpStorm from the shell; it is the other way around). It contains the path of the shell to launch (by PhpStorm) in its Terminal window (menu -> View
-> Tool Windows
-> Terminal
).
Latest standalone version doesn't come with pstorm shell script. We can create one at /usr/local/bin/pstorm
.
#!/bin/sh
open -na "PhpStorm.app" --args "$@"
Give permission to execute pstorm
.
chmod 0755 /usr/local/bin/pstorm
Reference: https://www.jetbrains.com/help/phpstorm/working-with-the-ide-features-from-command-line.html#standalone
If you are using Toolbox App, it can generate scripts for you.
Reference: https://www.jetbrains.com/help/phpstorm/working-with-the-ide-features-from-command-line.html#standalone
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With