diff --git a/On-MacVim-with-iTerm2.md b/On-MacVim-with-iTerm2.md index a1283c0..f3053aa 100644 --- a/On-MacVim-with-iTerm2.md +++ b/On-MacVim-with-iTerm2.md @@ -93,7 +93,10 @@ osascript -e \ end tell tell application "iTerm2" set myterm to (create window with default profile) - tell current session of first window + tell myterm + select + end + tell current session of myterm write text "cd " & quoted form of (item 2 of argv) write text (item 1 of argv) & " && exit" end tell @@ -105,4 +108,6 @@ osascript -e \ activate end tell end run' "$1" "$PWD" -``` \ No newline at end of file +``` + +The `tell myterm select` may be helpful when the new window opens on a monitor which does not have the main iTerm2 window. My system, running macOS Sierra, does not automatically focus the newly opened window. \ No newline at end of file