vim-iterm2-navigator icon indicating copy to clipboard operation
vim-iterm2-navigator copied to clipboard

Not working with latest iTerm2

Open thlorenz opened this issue 10 years ago • 5 comments

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.

thlorenz avatar Oct 08 '14 15:10 thlorenz

Are there any fixes for iTerm2 Build 3.0.13?

normenmueller avatar Feb 11 '17 15:02 normenmueller

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 avatar Feb 11 '17 15:02 normenmueller

Also posted at iTerm2

normenmueller avatar Feb 11 '17 16:02 normenmueller

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.

antonzub1 avatar Jun 07 '17 08:06 antonzub1

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

Charlesleonius avatar Oct 23 '19 18:10 Charlesleonius