iTerm2 -> Preferences -> Profiles -> Advanced -> Semantic History -> Run command
/Applications/WebStorm.app/Contents/MacOS/webstorm \1 --line \2