Skip to content

Instantly share code, notes, and snippets.

@Rpsl
Last active May 25, 2021 19:28
Show Gist options
  • Select an option

  • Save Rpsl/7870906 to your computer and use it in GitHub Desktop.

Select an option

Save Rpsl/7870906 to your computer and use it in GitHub Desktop.
Open iTerm terminal from PhpStorm ( NativeNeighbourhood plugin );
cd ~/Library/Application\ Support/WebIde70/NativeNeighbourhood/classes/org/intellij/plugins/nativeNeighbourhood/icons/macosx
echo '#!/bin/sh
#
# Reveal a directory in the Terminal.
#
# The script takes one argument, the qualified name of a directory.
#
# Note that the script is necessary because osascript before osx 10.4 could not
# pass arguments.
#
/usr/bin/osascript <<EOF
tell application "iTerm"
activate
delay 1
-- talk to the first terminal
tell the first terminal
try
-- launch a default shell in a new tab in the same terminal
launch session "Default Session"
on error
display dialog "There was an error creating a new tab in iTerm." buttons {"OK"}
end try
tell the last session
try
-- cd to the finder window
write text "cd $1"
on error
display dialog "There was an error cding to the finder window." buttons {"OK"}
end try
end tell
end tell
end tell
EOF' > terminal.sh
@FlorianGoussin
Copy link
Copy Markdown

Hi,
How should I use this?
Is there a special way to launch a sh file from phpstorm?
Thx.

@sbglasius
Copy link
Copy Markdown

Install the plugin "NativeNeighbourhood" plugin (works in IntelliJ IDEA also) and do as instructed above. If you are using IntelliJ Idea, replace WebIde70 with IntelliJIdea14.

Thanks @Rpsl for this nice trick!

@lukrizal
Copy link
Copy Markdown

How about for Windows 10? If I want to instruct PHPStorm to use Git Bash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment