Command hook for the global hotkey
By ole.johan.varings... on September 03, 2012 22:41 (imported from Google Code)
I would like to be able to hook on a command to be called when iterm2 is given focus.
A specific use case: On my Gentoo box I switch between terminal windows on different monitors with hotkeys. The hotkeys just call scripts that set focus to the terminal, meaning I can execute whatever I want in addition to set focus. I have a script that checks if the tmux window in the terminal given focus has more than one pane open, and if so, calls the display-panes command so I can select the pane directly. I have found this to be a great feature to have when I do a lot of terminal window switching with a lot of panes open.
You could probably set up that specific feature directly, with the tmux integration and all, but being able to hook on your customized commands is more open and powerful.