Skip to content

Instantly share code, notes, and snippets.

@raulanatol
Last active September 30, 2015 08:35
Show Gist options
  • Save raulanatol/759860637fd6144ee19e to your computer and use it in GitHub Desktop.
Save raulanatol/759860637fd6144ee19e to your computer and use it in GitHub Desktop.
Create new terminal instance on the same path
#New terminal in the same position
function nt {
PWD_VALUE=$PWD
osascript -e "
tell application \"System Events\" to tell process \"Terminal\" to keystroke \"n\" using command down
tell application \"iTerm\" to tell session -1 of current terminal to write text \"cd $PWD_VALUE\"
" > /dev/null 2>&1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment