teajaymars / vim-iterm2-navigator

Seamlessly navigate vim split panes inside iterm2 split panes
17 stars 15 forks source link

Not working with latest iTerm2 #2

Open thlorenz opened 10 years ago

thlorenz commented 10 years ago

Things weren't working for me, so I ran the command on the command line to see what's going on:

➝  ~/dotfiles/vim/bundle/iterm2-navigator/switch.py h
/Users/thlorenz/dotfiles/vim/bundle/iterm2-navigator/applescript/iterm2_getname.scpt: execution error: iTerm got an error: Can’t get «class Ctrm». (-1728)
Traceback (most recent call last):
  File "/Users/thlorenz/dotfiles/vim/bundle/iterm2-navigator/switch.py", line 15, in <module>
    name = subprocess.check_output(['osascript',path_to('iterm2_getname.scpt')])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 575, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['osascript', '/Users/thlorenz/dotfiles/vim/bundle/iterm2-navigator/applescript/iterm2_getname.scpt']' returned non-zero exit status 1

I'm using iTerm2 Build 2.9.20141006-nightly.

It'd be awesome to get this to work, so any idea what's going on? Thanks.

normenmueller commented 7 years ago

Are there any fixes for iTerm2 Build 3.0.13?

normenmueller commented 7 years ago

Initiating the scripts directly works just fine, e.g.

$ .vim/bundle/vim-iterm2-navigator/switch.py h

But the mapping within iTerm2 Build 3.0.13 just does nothing, e.g,

Key Combination: Ctrl + Cmd + h Action: Run Coprosses "~/.vim/bundle/vim-iterm2-navigator/switch.py h"

normenmueller commented 7 years ago

Also posted at iTerm2

antonzub1 commented 7 years ago

I can confirm this issue on Iterm2 3.0.12. However, fix from https://github.com/zephod/vim-iterm2-navigator/pull/3 helper me to resolve this issue.

Charlesleonius commented 5 years ago

I rewrote the switching script in bash to make this a little faster if you guys are still using it:


#!/bin/sh
BASE_DIR=$(dirname "$0")
PROC_NAME=$(osascript ${BASE_DIR}/applescript/iterm2_getname.scpt)
if [[ "$PROC_NAME" == *"vim"* ]];
then
    echo '\x1b'
    echo ":call SwitchWindow(\"$1\")"
    echo '\r'
else
    osascript "${BASE_DIR}/applescript/iterm2_$1.scpt"
fi