Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trvsdnn/366420 to your computer and use it in GitHub Desktop.
Save trvsdnn/366420 to your computer and use it in GitHub Desktop.
#!/bin/sh -
if [ $# -ne 1 ]; then
NEWPATH=$PWD
else
NEWPATH=$1
fi
/usr/bin/osascript <<-EOF
activate application "Terminal"
tell application "System Events"
keystroke "t" using {command down}
end tell
tell application "Terminal"
do script "cd $NEWPATH; clear" in (selected tab of the front window)
end tell
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment