[TxMt] Feature request: "Open Terminal here ..."

Fred B fredb7 at gmail.com
Thu May 3 12:00:55 UTC 2007


On 5/3/07, Antoine Beyeler <abeyeler at dplanet.ch> wrote:
> What if you want to use iTerm instead? :-)

Here is the one I use:

if [[ -d $TM_SELECTED_FILE ]]; then
   TM_PATH="$TM_SELECTED_FILE"
elif [[ -f $TM_SELECTED_FILE ]]; then
   TM_PATH="`dirname "$TM_SELECTED_FILE"`"
else
   TM_PATH="`dirname "$TM_FILEPATH"`"
fi

osascript <<EOF
tell application "iTerm"
  activate
	if exists the first terminal then
		set myterm to the first terminal
	else
		set myterm to (make new terminal)
	end if
	tell myterm
	  activate current session
	  launch session "Default Session"
		tell the last session
			write text "cd '$TM_PATH'; clear; pwd"
		end tell
  end tell
end tell
EOF



More information about the textmate mailing list