-
-
Save ndreas/770735 to your computer and use it in GitHub Desktop.
The changes were made twice in the binary "iTerm Module" since the script is embedded twice. I just opened the binary in Vim and searched for "activate" to find the scripts. | |
Changes: | |
- Create a new window instead of a tab (I prefer it that way) | |
- Launch the default session instead of creating a new session | |
- Disable the bash-commands since it overrode my default shell, zsh | |
The strange indentation in the modified file is due to the fact that the binary b0rks if the string length is changed. If it does not work, try removing or adding characters in the script. Quicksilver generates an error message on startup (for example in Console.app) if there is something wrong with the binary. |
tell application "iTerm" | |
activate | |
set aterm to (make new terminal) | |
tell aterm to launch session "Default" | |
tell aterm to set asession to current session | |
--to exec command "/bin/bash --login" | |
tell asession to write text "%@" | |
end tell |
tell application "iTerm" | |
activate | |
set aterm to (first terminal) | |
tell aterm to set asession to (make new session at the end of sessions) | |
tell asession to exec command "/bin/bash --login" | |
tell asession to write text "%@" | |
end tell |
I did some testing and I cant reproduce your error. First of all, I had a different path to my plugin, so I downloaded the plugin from here: http://qsapp.com/plugins.php to make it match your path. I applied the changes from the script above and everything worked fine for me.
However, I suspect from your error message that whichever editor you used to change the binary might have written some bad data at the start of the file. If dump the start of the file I get the following:
> hexdump iTerm\ Module | head
0000000 ca fe ba be 00 00 00 02 00 00 00 12 00 00 00 00
0000010 00 00 10 00 00 00 5e 0c 00 00 00 0c 00 00 00 07
0000020 00 00 00 03 00 00 70 00 00 00 6d 7c 00 00 00 0c
0000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
I get the same on an unchanged binary. I suggest you look at what your file looks like in a hex editor and see if the start of the file matches the error message you get. If that's the case, try using an editor that does not modify the head of the file in any way.
I have the same first few bytes according to hexdump. I'm using emacs which, I think, edits hex without changing the file other than the bytes edited. Any chance you can share you binary?
Are you sure this is easier than a rewrite? :-)
@mankoff: http://dl.dropbox.com/u/1434942/iterm-mod.tar.bz2 see if that one works for you.
@skurfer: a rewrite would be best, I'll take a look at it. I've skimmed through the code for the Terminal plugin and it doesn't seem that difficult to make a corresponding plugin for iTerm2. I'll just have to learn Objective C :)
Works great. Not sure why my edits didn't. Thank you very much!
@mankoff: Try my new plugin: https://github.com/ndreas/iTerm2-qsplugin/downloads
I type a folder name, hit tab, and type 'iterm' and nothing shows up with this plugin. With the previous one, I could select "Go to directory in iTerm".
I only used the Terminal commands with iTerm set as the provider, so the plugin only supported those commands. However, I've updated the plugin to supply iTerm-specific commands: https://github.com/ndreas/iTerm2-qsplugin/downloads
When I make this change, the file size remains the same: 56700 bytes, so I think I did it correctly. But QS won't load it. Console has the following error: