-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update iTerm script #26
Conversation
Thanks for digging into this. Are you saying it doesn't work for older iTerm2 releases? With your changes, what's the behavior if you are in, say, MacVim? Does |
Yes the functionality appears to be the same. And yes, this would break old releases. On a related note, it seems it might be possible to drop applescript all together. Calling the system command works just fine even with iterm:
|
Dropping applescript would be great.
Does that work for the following cases:
|
Yes, it works for all those cases. |
@@ -139,7 +139,7 @@ func! gtfo#open#term(dir, cmd) "{{{ | |||
call s:restore_shell() | |||
elseif s:ismac | |||
if (s:empty(s:termpath) && $TERM_PROGRAM ==? 'iTerm.app') || s:termpath ==? "iterm" | |||
silent call s:mac_open_iTerm(l:dir) | |||
silent call system("open -a ".s:termpath." '".l:dir."'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a line above this for the empty case, similar to line 144:
if s:empty(s:termpath) | let s:termpath = 'iTerm.app' | endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, that will break on the next invocation (because s:termpath
is no longer empty). Instead, it can just be:
if (s:empty(s:termpath) && $TERM_PROGRAM ==? 'iTerm.app') || s:termpath ==? "iterm"
silent call system("open -a iTerm '".l:dir."'")
@kevintraver Thanks. Can you squash to 1 commit? |
Thanks! |
iTerm2 made some changes to its scripting, which causes 'got' to silently fail when using iTerm2, and setting
let g:gtfo#terminals = { 'mac' : 'iterm' }
Here is the new scripting commands:
https://github.com/gnachman/iTerm2/blob/master/iTerm2.sdef
Perhaps it might be necessary to check and have separate scripts for iTerm/iTerm2.
Thoughts?