Skip to content

Instantly share code, notes, and snippets.

@Rpsl
Last active October 10, 2017 09:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rpsl/b8337d0f0c18320da2e7 to your computer and use it in GitHub Desktop.
Save Rpsl/b8337d0f0c18320da2e7 to your computer and use it in GitHub Desktop.
Open iTerm (2.9+) terminal from PhpStorm/WebStorm/Idea ( NativeNeighbourhood plugin ); Raw
cd ~/Library/Application\ Support/WebIde100/NativeNeighbourhood/classes/org/intellij/plugins/nativeNeighbourhood/icons/macosx
echo '#!/bin/sh
#
# !!!This is only for iTerm 2.9 and above!!!
#
# 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
set close_first_tab to false
try
set myWindow to (select first window)
on error e number n
create window with default profile
set close_first_tab to true
end try
try
tell current window
-- These commands return a tab
set newTab to (create tab with default profile)
tell newTab
tell current session
write text "cd $1"
end tell
end tell
if close_first_tab then
tell first tab
delay 1
close
end tell
end if
end tell
on error e number n
display dialog "my variable: " & e
end try
end tell
EOF' > terminal.sh
@rcubitto
Copy link

What's the next step after updating the terminal.sh file?

@mibocs
Copy link

mibocs commented Feb 12, 2017

This doesn't work for me either. Could you provide a detailed step by step guide?. Thanks!

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