Skip to content

Instantly share code, notes, and snippets.

@rcconsult
Forked from gnachman/iterm.scpt
Created May 30, 2018 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcconsult/6c24fd7941d810ec5890f2db17ad3845 to your computer and use it in GitHub Desktop.
Save rcconsult/6c24fd7941d810ec5890f2db17ad3845 to your computer and use it in GitHub Desktop.
Replace /Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/iterm.scpt with this.
set itermRunning to (application "iTerm" is running)
set scriptPath to quoted form of POSIX path of ((path to me as text) & "::" & "start.sh")
set user_shell to do shell script "dscl /Search -read /Users/$USER UserShell | awk '{print $2}'"
tell application "iTerm"
activate
if not (exists window 1) or (itermRunning = false) then
reopen
end if
try
tell current window
set newTab to (create tab with default profile)
tell current session of newTab
write text "bash --login " & scriptPath
end tell
end tell
on error
tell current session of (create window with default profile)
write text "bash --login " & scriptPath
end tell
end try
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment